linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PATCH - md 7 of 22 - Use wait_event_interuptible in md_thread
@ 2002-06-19  0:51 Neil Brown
  0 siblings, 0 replies; only message in thread
From: Neil Brown @ 2002-06-19  0:51 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-raid




It currently has several lines of code where one will do.



 ----------- Diffstat output ------------
 ./drivers/md/md.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

--- ./drivers/md/md.c	2002/06/18 03:34:17	1.6
+++ ./drivers/md/md.c	2002/06/18 03:37:06	1.7
@@ -2929,17 +2929,10 @@
 	complete(thread->event);
 	while (thread->run) {
 		void (*run)(void *data);
-		DECLARE_WAITQUEUE(wait, current);
 
-		add_wait_queue(&thread->wqueue, &wait);
-		set_task_state(current, TASK_INTERRUPTIBLE);
-		if (!test_bit(THREAD_WAKEUP, &thread->flags)) {
-			dprintk("md: thread %p went to sleep.\n", thread);
-			schedule();
-			dprintk("md: thread %p woke up.\n", thread);
-		}
-		current->state = TASK_RUNNING;
-		remove_wait_queue(&thread->wqueue, &wait);
+		wait_event_interruptible(thread->wqueue,
+					 test_bit(THREAD_WAKEUP, &thread->flags));
+
 		clear_bit(THREAD_WAKEUP, &thread->flags);
 
 		run = thread->run;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-06-19  0:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-19  0:51 PATCH - md 7 of 22 - Use wait_event_interuptible in md_thread Neil Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).