Make wake_up callback-safe
PATCH 1/1 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 <[email protected]>
extras/mini-os/include/wait.h +3 -0
@@ -57,13 +57,16 @@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 { \