summaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-05-29 09:12:30 -0700
committerSage Weil <sage@newdream.net>2010-05-29 09:12:30 -0700
commit0aa12fb439838a85802ab8b7fbb9bcfc3e6e05cb (patch)
treec944cf9abba9a6afb3d1259140c73101d0e222a0 /kernel/sched.c
parent240ed68eb567d80dd6bab739341999a5ab0ad55d (diff)
downloadlinux-0aa12fb439838a85802ab8b7fbb9bcfc3e6e05cb.tar.gz
linux-0aa12fb439838a85802ab8b7fbb9bcfc3e6e05cb.tar.bz2
linux-0aa12fb439838a85802ab8b7fbb9bcfc3e6e05cb.zip
sched: add wait_for_completion_killable_timeout
Add missing _killable_timeout variant for wait_for_completion that will return when a timeout expires or the task is killed. CC: Ingo Molnar <mingo@elte.hu> CC: Andreas Herrmann <andreas.herrmann3@amd.com> CC: Thomas Gleixner <tglx@linutronix.de> CC: Mike Galbraith <efault@gmx.de> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 3c2a54f70ffe..4d051c7517fd 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4161,6 +4161,23 @@ int __sched wait_for_completion_killable(struct completion *x)
EXPORT_SYMBOL(wait_for_completion_killable);
/**
+ * wait_for_completion_killable_timeout: - waits for completion of a task (w/(to,killable))
+ * @x: holds the state of this particular completion
+ * @timeout: timeout value in jiffies
+ *
+ * This waits for either a completion of a specific task to be
+ * signaled or for a specified timeout to expire. It can be
+ * interrupted by a kill signal. The timeout is in jiffies.
+ */
+unsigned long __sched
+wait_for_completion_killable_timeout(struct completion *x,
+ unsigned long timeout)
+{
+ return wait_for_common(x, timeout, TASK_KILLABLE);
+}
+EXPORT_SYMBOL(wait_for_completion_killable_timeout);
+
+/**
* try_wait_for_completion - try to decrement a completion without blocking
* @x: completion structure
*