Changes in kernel/generic/src/synch/waitq.c [7c3fb9b:b59318e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/synch/waitq.c
r7c3fb9b rb59318e 57 57 #include <adt/list.h> 58 58 #include <arch/cycle.h> 59 #include <mem.h> 59 60 60 61 static void waitq_sleep_timed_out(void *); … … 71 72 void waitq_initialize(waitq_t *wq) 72 73 { 74 memsetb(wq, sizeof(*wq), 0); 73 75 irq_spinlock_initialize(&wq->lock, "wq.lock"); 74 76 list_initialize(&wq->sleepers); 75 wq->missed_wakeups = 0;76 77 } 77 78 … … 114 115 thread->saved_context = thread->sleep_timeout_context; 115 116 do_wakeup = true; 117 if (thread->sleep_composable) 118 wq->ignore_wakeups++; 116 119 thread->sleep_queue = NULL; 117 120 irq_spinlock_unlock(&wq->lock, false); … … 176 179 list_remove(&thread->wq_link); 177 180 thread->saved_context = thread->sleep_interruption_context; 181 if (thread->sleep_composable) 182 wq->ignore_wakeups++; 178 183 do_wakeup = true; 179 184 thread->sleep_queue = NULL; … … 393 398 */ 394 399 irq_spinlock_lock(&THREAD->lock, false); 400 401 THREAD->sleep_composable = (flags & SYNCH_FLAGS_FUTEX); 395 402 396 403 if (flags & SYNCH_FLAGS_INTERRUPTIBLE) { … … 538 545 assert(irq_spinlock_locked(&wq->lock)); 539 546 547 if (wq->ignore_wakeups > 0) { 548 if (mode == WAKEUP_FIRST) { 549 wq->ignore_wakeups--; 550 return; 551 } 552 wq->ignore_wakeups = 0; 553 } 554 540 555 loop: 541 556 if (list_empty(&wq->sleepers)) {
Note:
See TracChangeset
for help on using the changeset viewer.