Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
58aa897f
Commit
58aa897f
authored
Jun 18, 2002
by
Neil Brown
Committed by
Linus Torvalds
Jun 18, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] md 7 of 22 - Use wait_event_interuptible in md_thread
It currently has several lines of code where one will do.
parent
26d2d542
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
drivers/md/md.c
drivers/md/md.c
+3
-10
No files found.
drivers/md/md.c
View file @
58aa897f
...
@@ -2929,17 +2929,10 @@ int md_thread(void * arg)
...
@@ -2929,17 +2929,10 @@ int md_thread(void * arg)
complete
(
thread
->
event
);
complete
(
thread
->
event
);
while
(
thread
->
run
)
{
while
(
thread
->
run
)
{
void
(
*
run
)(
void
*
data
);
void
(
*
run
)(
void
*
data
);
DECLARE_WAITQUEUE
(
wait
,
current
);
add_wait_queue
(
&
thread
->
wqueue
,
&
wait
);
wait_event_interruptible
(
thread
->
wqueue
,
set_task_state
(
current
,
TASK_INTERRUPTIBLE
);
test_bit
(
THREAD_WAKEUP
,
&
thread
->
flags
));
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
);
clear_bit
(
THREAD_WAKEUP
,
&
thread
->
flags
);
clear_bit
(
THREAD_WAKEUP
,
&
thread
->
flags
);
run
=
thread
->
run
;
run
=
thread
->
run
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment