ia64/xen-unstable

changeset 16444:2fd1ead7fdf5

[Mini-OS] Make wake_up callback-safe

As it may compete with event handlers waking wait queues, wake_up
needs to be callback-safe.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Sat Nov 24 13:27:59 2007 +0000 (2007-11-24)
parents fb7b96a980f6
children eac7ef8ba544
files extras/mini-os/include/wait.h
line diff
     1.1 --- a/extras/mini-os/include/wait.h	Sat Nov 24 13:27:32 2007 +0000
     1.2 +++ b/extras/mini-os/include/wait.h	Sat Nov 24 13:27:59 2007 +0000
     1.3 @@ -58,13 +58,16 @@ static inline void remove_wait_queue(str
     1.4  
     1.5  static inline void wake_up(struct wait_queue_head *head)
     1.6  {
     1.7 +    unsigned long flags;
     1.8      struct list_head *tmp, *next;
     1.9 +    local_irq_save(flags);
    1.10      list_for_each_safe(tmp, next, &head->thread_list)
    1.11      {
    1.12           struct wait_queue *curr;
    1.13           curr = list_entry(tmp, struct wait_queue, thread_list);
    1.14           wake(curr->thread);
    1.15      }
    1.16 +    local_irq_restore(flags);
    1.17  }
    1.18  
    1.19  #define add_waiter(w, wq) do {  \