Commit 64ed93a2 authored by Nishanth Aravamudan's avatar Nishanth Aravamudan Committed by Linus Torvalds

[PATCH] add schedule_timeout_{,un}interruptible() interfaces

Add schedule_timeout_{,un}interruptible() interfaces so that
schedule_timeout() callers don't have to worry about forgetting to add the
set_current_state() call beforehand.
Signed-off-by: default avatarNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 672289e9
...@@ -203,6 +203,8 @@ extern int in_sched_functions(unsigned long addr); ...@@ -203,6 +203,8 @@ extern int in_sched_functions(unsigned long addr);
#define MAX_SCHEDULE_TIMEOUT LONG_MAX #define MAX_SCHEDULE_TIMEOUT LONG_MAX
extern signed long FASTCALL(schedule_timeout(signed long timeout)); extern signed long FASTCALL(schedule_timeout(signed long timeout));
extern signed long schedule_timeout_interruptible(signed long timeout);
extern signed long schedule_timeout_uninterruptible(signed long timeout);
asmlinkage void schedule(void); asmlinkage void schedule(void);
struct namespace; struct namespace;
......
...@@ -1154,6 +1154,20 @@ fastcall signed long __sched schedule_timeout(signed long timeout) ...@@ -1154,6 +1154,20 @@ fastcall signed long __sched schedule_timeout(signed long timeout)
EXPORT_SYMBOL(schedule_timeout); EXPORT_SYMBOL(schedule_timeout);
signed long __sched schedule_timeout_interruptible(signed long timeout)
{
set_current_state(TASK_INTERRUPTIBLE);
return schedule_timeout(timeout);
}
EXPORT_SYMBOL(schedule_timeout_interruptible);
signed long __sched schedule_timeout_uninterruptible(signed long timeout)
{
set_current_state(TASK_UNINTERRUPTIBLE);
return schedule_timeout(timeout);
}
EXPORT_SYMBOL(schedule_timeout_uninterruptible);
/* Thread ID - the internal kernel "pid" */ /* Thread ID - the internal kernel "pid" */
asmlinkage long sys_gettid(void) asmlinkage long sys_gettid(void)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment