Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19345
b: refs/heads/master
c: bc1978d
h: refs/heads/master
i:
  19343: f18ea35
v: v3
  • Loading branch information
Thomas Gleixner authored and Linus Torvalds committed Feb 1, 2006
1 parent f322cbb commit 073df5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 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: 853609b61ef88b414ffd1613741aa59894334320
refs/heads/master: bc1978d404befacd272d0321ef749cc3192e488b
11 changes: 10 additions & 1 deletion trunk/kernel/itimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ int do_getitimer(int which, struct itimerval *value)

switch (which) {
case ITIMER_REAL:
spin_lock_irq(&tsk->sighand->siglock);
value->it_value = itimer_get_remtime(&tsk->signal->real_timer);
value->it_interval =
ktime_to_timeval(tsk->signal->it_real_incr);
spin_unlock_irq(&tsk->sighand->siglock);
break;
case ITIMER_VIRTUAL:
read_lock(&tasklist_lock);
Expand Down Expand Up @@ -150,8 +152,14 @@ int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue)

switch (which) {
case ITIMER_REAL:
again:
spin_lock_irq(&tsk->sighand->siglock);
timer = &tsk->signal->real_timer;
hrtimer_cancel(timer);
/* We are sharing ->siglock with it_real_fn() */
if (hrtimer_try_to_cancel(timer) < 0) {
spin_unlock_irq(&tsk->sighand->siglock);
goto again;
}
if (ovalue) {
ovalue->it_value = itimer_get_remtime(timer);
ovalue->it_interval
Expand All @@ -162,6 +170,7 @@ int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue)
expires = timeval_to_ktime(value->it_value);
if (expires.tv64 != 0)
hrtimer_start(timer, expires, HRTIMER_REL);
spin_unlock_irq(&tsk->sighand->siglock);
break;
case ITIMER_VIRTUAL:
nval = timeval_to_cputime(&value->it_value);
Expand Down

0 comments on commit 073df5a

Please sign in to comment.