From: Neil Brown <neilb@cse.unsw.edu.au>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-raid@vger.kernel.org
Subject: PATCH - md 7 of 22 - Use wait_event_interuptible in md_thread
Date: Wed, 19 Jun 2002 10:51:06 +1000 (EST) [thread overview]
Message-ID: <15631.54650.987308.141340@notabene.cse.unsw.edu.au> (raw)
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;
reply other threads:[~2002-06-19 0:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15631.54650.987308.141340@notabene.cse.unsw.edu.au \
--to=neilb@cse.unsw.edu.au \
--cc=linux-raid@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).