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
nexedi
linux
Commits
009e577e
Commit
009e577e
authored
Dec 06, 2007
by
Matthew Wilcox
Committed by
Matthew Wilcox
Dec 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add wait_for_completion_killable
Signed-off-by:
Matthew Wilcox
<
willy@linux.intel.com
>
parent
1411d5a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
include/linux/completion.h
include/linux/completion.h
+1
-0
kernel/sched.c
kernel/sched.c
+13
-2
No files found.
include/linux/completion.h
View file @
009e577e
...
...
@@ -44,6 +44,7 @@ static inline void init_completion(struct completion *x)
extern
void
wait_for_completion
(
struct
completion
*
);
extern
int
wait_for_completion_interruptible
(
struct
completion
*
x
);
extern
int
wait_for_completion_killable
(
struct
completion
*
x
);
extern
unsigned
long
wait_for_completion_timeout
(
struct
completion
*
x
,
unsigned
long
timeout
);
extern
unsigned
long
wait_for_completion_interruptible_timeout
(
...
...
kernel/sched.c
View file @
009e577e
...
...
@@ -3881,8 +3881,10 @@ do_wait_for_common(struct completion *x, long timeout, int state)
wait
.
flags
|=
WQ_FLAG_EXCLUSIVE
;
__add_wait_queue_tail
(
&
x
->
wait
,
&
wait
);
do
{
if
(
state
==
TASK_INTERRUPTIBLE
&&
signal_pending
(
current
))
{
if
((
state
==
TASK_INTERRUPTIBLE
&&
signal_pending
(
current
))
||
(
state
==
TASK_KILLABLE
&&
fatal_signal_pending
(
current
)))
{
__remove_wait_queue
(
&
x
->
wait
,
&
wait
);
return
-
ERESTARTSYS
;
}
...
...
@@ -3942,6 +3944,15 @@ wait_for_completion_interruptible_timeout(struct completion *x,
}
EXPORT_SYMBOL
(
wait_for_completion_interruptible_timeout
);
int
__sched
wait_for_completion_killable
(
struct
completion
*
x
)
{
long
t
=
wait_for_common
(
x
,
MAX_SCHEDULE_TIMEOUT
,
TASK_KILLABLE
);
if
(
t
==
-
ERESTARTSYS
)
return
t
;
return
0
;
}
EXPORT_SYMBOL
(
wait_for_completion_killable
);
static
long
__sched
sleep_on_common
(
wait_queue_head_t
*
q
,
int
state
,
long
timeout
)
{
...
...
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