Project

General

Profile

Feature #13552 ยป 0001-thread_sync.c-rename-mutex_waiter-struct-to-sync_wai.patch

normalperson (Eric Wong), 05/10/2017 12:16 AM

View differences:

thread_sync.c
6 6

  
7 7
/* Mutex */
8 8

  
9
/* mutex_waiter is always on-stack */
10
struct mutex_waiter {
9
/* sync_waiter is always on-stack */
10
struct sync_waiter {
11 11
    rb_thread_t *th;
12 12
    struct list_node node;
13 13
};
......
60 60
static size_t
61 61
rb_mutex_num_waiting(rb_mutex_t *mutex)
62 62
{
63
    struct mutex_waiter *w;
63
    struct sync_waiter *w;
64 64
    size_t n = 0;
65 65

  
66 66
    list_for_each(&mutex->waitq, w, node) {
......
213 213
    }
214 214

  
215 215
    if (rb_mutex_trylock(self) == Qfalse) {
216
	struct mutex_waiter w;
216
	struct sync_waiter w;
217 217

  
218 218
	if (mutex->th == th) {
219 219
	    rb_raise(rb_eThreadError, "deadlock; recursive locking");
......
299 299
    else if (mutex->th != th) {
300 300
	err = "Attempt to unlock a mutex which is locked by another thread";
301 301
    } else {
302
	struct mutex_waiter *cur = 0, *next = 0;
302
	struct sync_waiter *cur = 0, *next = 0;
303 303
	rb_mutex_t *volatile *th_mutex = &th->keeping_mutexes;
304 304

  
305 305
	mutex->th = 0;
306
-