Ignore:
File:
1 edited

Legend:

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

    r6c4a56f r98000fb  
    171171out:
    172172        spinlock_unlock(&threads_lock);
    173         interrupts_restore(ipl);
    174 }
    175 
    176 /** Interrupt the first thread sleeping in the wait queue.
    177  *
    178  * Note that the caller somehow needs to know that the thread to be interrupted
    179  * is sleeping interruptibly.
    180  *
    181  * @param wq            Pointer to wait queue.
    182  */
    183 void waitq_unsleep(waitq_t *wq)
    184 {
    185         ipl_t ipl;
    186 
    187         ipl = interrupts_disable();
    188         spinlock_lock(&wq->lock);
    189 
    190         if (!list_empty(&wq->head)) {
    191                 thread_t *t;
    192                
    193                 t = list_get_instance(wq->head.next, thread_t, wq_link);
    194                 spinlock_lock(&t->lock);
    195                 ASSERT(t->sleep_interruptible);
    196                 if (t->timeout_pending && timeout_unregister(&t->sleep_timeout))
    197                         t->timeout_pending = false;
    198                 list_remove(&t->wq_link);
    199                 t->saved_context = t->sleep_interruption_context;
    200                 t->sleep_queue = NULL;
    201                 spinlock_unlock(&t->lock);
    202                 thread_ready(t);
    203         }
    204 
    205         spinlock_unlock(&wq->lock);
    206173        interrupts_restore(ipl);
    207174}
Note: See TracChangeset for help on using the changeset viewer.