Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0aa12fb4 authored by Sage Weil's avatar Sage Weil
Browse files

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: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 240ed68e
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -83,6 +83,8 @@ extern unsigned long wait_for_completion_timeout(struct completion *x,
						   unsigned long timeout);
						   unsigned long timeout);
extern unsigned long wait_for_completion_interruptible_timeout(
extern unsigned long wait_for_completion_interruptible_timeout(
			struct completion *x, unsigned long timeout);
			struct completion *x, unsigned long timeout);
extern unsigned long wait_for_completion_killable_timeout(
			struct completion *x, unsigned long timeout);
extern bool try_wait_for_completion(struct completion *x);
extern bool try_wait_for_completion(struct completion *x);
extern bool completion_done(struct completion *x);
extern bool completion_done(struct completion *x);


+17 −0
Original line number Original line Diff line number Diff line
@@ -4160,6 +4160,23 @@ int __sched wait_for_completion_killable(struct completion *x)
}
}
EXPORT_SYMBOL(wait_for_completion_killable);
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
 *	try_wait_for_completion - try to decrement a completion without blocking
 *	@x:	completion structure
 *	@x:	completion structure