提交 c6dc7f05 编写于 作者: J J. Bruce Fields 提交者: Ingo Molnar

sched: Document wait_for_completion_*() return values

The return-value convention for these functions varies depending on
whether they're interruptible or can timeout.  It can be a little
confusing--document it.
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20111006192246.GB28026@fieldses.orgSigned-off-by: NIngo Molnar <mingo@elte.hu>
上级 461819ac
...@@ -4810,6 +4810,9 @@ EXPORT_SYMBOL(wait_for_completion); ...@@ -4810,6 +4810,9 @@ EXPORT_SYMBOL(wait_for_completion);
* This waits for either a completion of a specific task to be signaled or for a * This waits for either a completion of a specific task to be signaled or for a
* specified timeout to expire. The timeout is in jiffies. It is not * specified timeout to expire. The timeout is in jiffies. It is not
* interruptible. * interruptible.
*
* The return value is 0 if timed out, and positive (at least 1, or number of
* jiffies left till timeout) if completed.
*/ */
unsigned long __sched unsigned long __sched
wait_for_completion_timeout(struct completion *x, unsigned long timeout) wait_for_completion_timeout(struct completion *x, unsigned long timeout)
...@@ -4824,6 +4827,8 @@ EXPORT_SYMBOL(wait_for_completion_timeout); ...@@ -4824,6 +4827,8 @@ EXPORT_SYMBOL(wait_for_completion_timeout);
* *
* This waits for completion of a specific task to be signaled. It is * This waits for completion of a specific task to be signaled. It is
* interruptible. * interruptible.
*
* The return value is -ERESTARTSYS if interrupted, 0 if completed.
*/ */
int __sched wait_for_completion_interruptible(struct completion *x) int __sched wait_for_completion_interruptible(struct completion *x)
{ {
...@@ -4841,6 +4846,9 @@ EXPORT_SYMBOL(wait_for_completion_interruptible); ...@@ -4841,6 +4846,9 @@ EXPORT_SYMBOL(wait_for_completion_interruptible);
* *
* This waits for either a completion of a specific task to be signaled or for a * This waits for either a completion of a specific task to be signaled or for a
* specified timeout to expire. It is interruptible. The timeout is in jiffies. * specified timeout to expire. It is interruptible. The timeout is in jiffies.
*
* The return value is -ERESTARTSYS if interrupted, 0 if timed out,
* positive (at least 1, or number of jiffies left till timeout) if completed.
*/ */
long __sched long __sched
wait_for_completion_interruptible_timeout(struct completion *x, wait_for_completion_interruptible_timeout(struct completion *x,
...@@ -4856,6 +4864,8 @@ EXPORT_SYMBOL(wait_for_completion_interruptible_timeout); ...@@ -4856,6 +4864,8 @@ EXPORT_SYMBOL(wait_for_completion_interruptible_timeout);
* *
* This waits to be signaled for completion of a specific task. It can be * This waits to be signaled for completion of a specific task. It can be
* interrupted by a kill signal. * interrupted by a kill signal.
*
* The return value is -ERESTARTSYS if interrupted, 0 if completed.
*/ */
int __sched wait_for_completion_killable(struct completion *x) int __sched wait_for_completion_killable(struct completion *x)
{ {
...@@ -4874,6 +4884,9 @@ EXPORT_SYMBOL(wait_for_completion_killable); ...@@ -4874,6 +4884,9 @@ EXPORT_SYMBOL(wait_for_completion_killable);
* This waits for either a completion of a specific task to be * This waits for either a completion of a specific task to be
* signaled or for a specified timeout to expire. It can be * signaled or for a specified timeout to expire. It can be
* interrupted by a kill signal. The timeout is in jiffies. * interrupted by a kill signal. The timeout is in jiffies.
*
* The return value is -ERESTARTSYS if interrupted, 0 if timed out,
* positive (at least 1, or number of jiffies left till timeout) if completed.
*/ */
long __sched long __sched
wait_for_completion_killable_timeout(struct completion *x, wait_for_completion_killable_timeout(struct completion *x,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册