Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8413
b: refs/heads/master
c: 75bcc8c
h: refs/heads/master
i:
  8411: 891fbd9
v: v3
  • Loading branch information
Nishanth Aravamudan authored and Linus Torvalds committed Sep 10, 2005
1 parent ca088e3 commit 46d3538
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 041e0e3b1970c508dc9a95b7dd9dc86271a7d7ac
refs/heads/master: 75bcc8c5e1de78616b04ef9f317a293a7c1c163c
9 changes: 3 additions & 6 deletions trunk/kernel/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ static long compat_nanosleep_restart(struct restart_block *restart)
if (!time_after(expire, now))
return 0;

current->state = TASK_INTERRUPTIBLE;
expire = schedule_timeout(expire - now);
expire = schedule_timeout_interruptible(expire - now);
if (expire == 0)
return 0;

Expand Down Expand Up @@ -82,8 +81,7 @@ asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
return -EINVAL;

expire = timespec_to_jiffies(&t) + (t.tv_sec || t.tv_nsec);
current->state = TASK_INTERRUPTIBLE;
expire = schedule_timeout(expire);
expire = schedule_timeout_interruptible(expire);
if (expire == 0)
return 0;

Expand Down Expand Up @@ -795,8 +793,7 @@ compat_sys_rt_sigtimedwait (compat_sigset_t __user *uthese,
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);

current->state = TASK_INTERRUPTIBLE;
timeout = schedule_timeout(timeout);
timeout = schedule_timeout_interruptible(timeout);

spin_lock_irq(&current->sighand->siglock);
sig = dequeue_signal(current, &s, &info);
Expand Down
3 changes: 1 addition & 2 deletions trunk/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2221,8 +2221,7 @@ sys_rt_sigtimedwait(const sigset_t __user *uthese,
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);

current->state = TASK_INTERRUPTIBLE;
timeout = schedule_timeout(timeout);
timeout = schedule_timeout_interruptible(timeout);

try_to_freeze();
spin_lock_irq(&current->sighand->siglock);
Expand Down
18 changes: 6 additions & 12 deletions trunk/kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,8 +1184,7 @@ static long __sched nanosleep_restart(struct restart_block *restart)
if (!time_after(expire, now))
return 0;

current->state = TASK_INTERRUPTIBLE;
expire = schedule_timeout(expire - now);
expire = schedule_timeout_interruptible(expire - now);

ret = 0;
if (expire) {
Expand Down Expand Up @@ -1213,8 +1212,7 @@ asmlinkage long sys_nanosleep(struct timespec __user *rqtp, struct timespec __us
return -EINVAL;

expire = timespec_to_jiffies(&t) + (t.tv_sec || t.tv_nsec);
current->state = TASK_INTERRUPTIBLE;
expire = schedule_timeout(expire);
expire = schedule_timeout_interruptible(expire);

ret = 0;
if (expire) {
Expand Down Expand Up @@ -1612,10 +1610,8 @@ void msleep(unsigned int msecs)
{
unsigned long timeout = msecs_to_jiffies(msecs) + 1;

while (timeout) {
set_current_state(TASK_UNINTERRUPTIBLE);
timeout = schedule_timeout(timeout);
}
while (timeout)
timeout = schedule_timeout_uninterruptible(timeout);
}

EXPORT_SYMBOL(msleep);
Expand All @@ -1628,10 +1624,8 @@ unsigned long msleep_interruptible(unsigned int msecs)
{
unsigned long timeout = msecs_to_jiffies(msecs) + 1;

while (timeout && !signal_pending(current)) {
set_current_state(TASK_INTERRUPTIBLE);
timeout = schedule_timeout(timeout);
}
while (timeout && !signal_pending(current))
timeout = schedule_timeout_interruptible(timeout);
return jiffies_to_msecs(timeout);
}

Expand Down

0 comments on commit 46d3538

Please sign in to comment.