Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 55b77d9 in mainline for kernel/generic/src/synch/waitq.c


Ignore:
Timestamp:
2011-06-17T20:39:16Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
8f164724
Parents:
98caf49
Message:

Separate list_t typedef from link_t (kernel part).

  • list_t represents lists
  • Use list_first(), list_last(), list_empty() where appropriate
  • Use list_foreach() where possible
  • Replace improper uses of list_prepend() with list_insert_after()
  • Replace improper uses of list_append() with list_insert_before()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/synch/waitq.c

    r98caf49 r55b77d9  
    6969{
    7070        irq_spinlock_initialize(&wq->lock, "wq.lock");
    71         list_initialize(&wq->head);
     71        list_initialize(&wq->sleepers);
    7272        wq->missed_wakeups = 0;
    7373}
     
    196196        irq_spinlock_lock(&wq->lock, true);
    197197       
    198         if (!list_empty(&wq->head)) {
    199                 thread_t *thread = list_get_instance(wq->head.next, thread_t, wq_link);
     198        if (!list_empty(&wq->sleepers)) {
     199                thread_t *thread = list_get_instance(list_first(&wq->sleepers),
     200                    thread_t, wq_link);
    200201               
    201202                irq_spinlock_lock(&thread->lock, false);
     
    407408        }
    408409       
    409         list_append(&THREAD->wq_link, &wq->head);
     410        list_append(&THREAD->wq_link, &wq->sleepers);
    410411       
    411412        /*
     
    464465       
    465466loop:
    466         if (list_empty(&wq->head)) {
     467        if (list_empty(&wq->sleepers)) {
    467468                wq->missed_wakeups++;
    468469                if ((count) && (mode == WAKEUP_ALL))
     
    473474       
    474475        count++;
    475         thread_t *thread = list_get_instance(wq->head.next, thread_t, wq_link);
     476        thread_t *thread = list_get_instance(list_first(&wq->sleepers),
     477            thread_t, wq_link);
    476478       
    477479        /*
Note: See TracChangeset for help on using the changeset viewer.