patch-2.1.30 linux/include/linux/sched.h

Next file: linux/include/linux/skbuff.h
Previous file: linux/include/linux/route.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.29/linux/include/linux/sched.h linux/include/linux/sched.h
@@ -410,14 +410,15 @@
 	wait->next = next;
 }
 
+extern spinlock_t waitqueue_lock;
+
 extern inline void add_wait_queue(struct wait_queue ** p, struct wait_queue * wait)
 {
 	unsigned long flags;
 
-	save_flags(flags);
-	cli();
+	spin_lock_irqsave(&waitqueue_lock, flags);
 	__add_wait_queue(p, wait);
-	restore_flags(flags);
+	spin_unlock_irqrestore(&waitqueue_lock, flags);
 }
 
 extern inline void __remove_wait_queue(struct wait_queue ** p, struct wait_queue * wait)
@@ -438,10 +439,9 @@
 {
 	unsigned long flags;
 
-	save_flags(flags);
-	cli();
+	spin_lock_irqsave(&waitqueue_lock, flags);
 	__remove_wait_queue(p, wait);
-	restore_flags(flags);
+	spin_unlock_irqrestore(&waitqueue_lock, flags); 
 }
 
 extern inline void poll_wait(struct wait_queue ** wait_address, poll_table * p)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov