diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2005-09-10 03:27:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-10 13:06:36 -0400 |
commit | 64ed93a268bc18fa6f72f61420d0e0022c5e38d1 (patch) | |
tree | 1332ce542510b88014767f3536d9150710a2f3f9 | |
parent | 672289e9faa56acd4e39ad866ea258b7be7c99a6 (diff) |
[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: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | include/linux/sched.h | 2 | ||||
-rw-r--r-- | kernel/timer.c | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index ac70f845b5b1..4b83cb230006 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -203,6 +203,8 @@ extern int in_sched_functions(unsigned long addr); | |||
203 | 203 | ||
204 | #define MAX_SCHEDULE_TIMEOUT LONG_MAX | 204 | #define MAX_SCHEDULE_TIMEOUT LONG_MAX |
205 | extern signed long FASTCALL(schedule_timeout(signed long timeout)); | 205 | extern signed long FASTCALL(schedule_timeout(signed long timeout)); |
206 | extern signed long schedule_timeout_interruptible(signed long timeout); | ||
207 | extern signed long schedule_timeout_uninterruptible(signed long timeout); | ||
206 | asmlinkage void schedule(void); | 208 | asmlinkage void schedule(void); |
207 | 209 | ||
208 | struct namespace; | 210 | struct namespace; |
diff --git a/kernel/timer.c b/kernel/timer.c index 13e2b513be01..a0b716d62701 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -1154,6 +1154,20 @@ fastcall signed long __sched schedule_timeout(signed long timeout) | |||
1154 | 1154 | ||
1155 | EXPORT_SYMBOL(schedule_timeout); | 1155 | EXPORT_SYMBOL(schedule_timeout); |
1156 | 1156 | ||
1157 | signed long __sched schedule_timeout_interruptible(signed long timeout) | ||
1158 | { | ||
1159 | set_current_state(TASK_INTERRUPTIBLE); | ||
1160 | return schedule_timeout(timeout); | ||
1161 | } | ||
1162 | EXPORT_SYMBOL(schedule_timeout_interruptible); | ||
1163 | |||
1164 | signed long __sched schedule_timeout_uninterruptible(signed long timeout) | ||
1165 | { | ||
1166 | set_current_state(TASK_UNINTERRUPTIBLE); | ||
1167 | return schedule_timeout(timeout); | ||
1168 | } | ||
1169 | EXPORT_SYMBOL(schedule_timeout_uninterruptible); | ||
1170 | |||
1157 | /* Thread ID - the internal kernel "pid" */ | 1171 | /* Thread ID - the internal kernel "pid" */ |
1158 | asmlinkage long sys_gettid(void) | 1172 | asmlinkage long sys_gettid(void) |
1159 | { | 1173 | { |