[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# 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 <samuel.thibault@xxxxxxxxxx>
---
 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
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.