[xen-unstable] [Mini-OS] Make wake_up callback-safe

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen-unstable] [Mini-OS] Make wake_up callback-safe

Xen patchbot-unstable
# HG changeset patch
# User Keir Fraser <[hidden email]>
# Date 1195910879 0
# Node ID 2fd1ead7fdf59ddf999820a76991c51fcc001b95
# Parent  fb7b96a980f60de93669cfb68b4e9da61ae413e3
[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 <[hidden email]>
---
 extras/mini-os/include/wait.h |    3 +++
 1 files changed, 3 insertions(+)

diff -r fb7b96a980f6 -r 2fd1ead7fdf5 extras/mini-os/include/wait.h
--- a/extras/mini-os/include/wait.h Sat Nov 24 13:27:32 2007 +0000
+++ b/extras/mini-os/include/wait.h Sat Nov 24 13:27:59 2007 +0000
@@ -58,13 +58,16 @@ static inline void remove_wait_queue(str
 
 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 {  \

_______________________________________________
Xen-changelog mailing list
[hidden email]
http://lists.xensource.com/xen-changelog