From: Keir Fraser Date: Sat, 24 Nov 2007 13:27:59 +0000 (+0000) Subject: [Mini-OS] Make wake_up callback-safe X-Git-Tag: xen-3.2.0-rc1~10 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=bab44af1417ffe80d51723232d43c4bb81e6088f;p=mini-os.git [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 --- diff --git a/include/wait.h b/include/wait.h index b7af396..6bd4d0c 100644 --- a/include/wait.h +++ b/include/wait.h @@ -58,13 +58,16 @@ static inline void remove_wait_queue(struct wait_queue *q) static inline void wake_up(struct wait_queue_head *head) { + unsigned long flags; struct list_head *tmp, *next; + local_irq_save(flags); list_for_each_safe(tmp, next, &head->thread_list) { struct wait_queue *curr; curr = list_entry(tmp, struct wait_queue, thread_list); wake(curr->thread); } + local_irq_restore(flags); } #define add_waiter(w, wq) do { \