Changeset 6a44ee4 in mainline for kernel/generic/src/synch/waitq.c


Ignore:
Timestamp:
2011-07-20T15:26:21Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
efcebe1
Parents:
25bef0ff (diff), a701812 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    r25bef0ff r6a44ee4  
    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.