Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10086
b: refs/heads/master
c: a69ac4a
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Oct 24, 2005
1 parent 9715883 commit 599c3b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 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: ca531a0a5e01e5122f67cb6aca8fcbfc70e18e0b
refs/heads/master: a69ac4a78d8bd9e1ec478bd7297d4f047fcd44a8
12 changes: 8 additions & 4 deletions trunk/kernel/posix-cpu-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,9 +730,15 @@ int posix_cpu_timer_set(struct k_itimer *timer, int flags,
* Disarm any old timer after extracting its expiry time.
*/
BUG_ON(!irqs_disabled());

ret = 0;
spin_lock(&p->sighand->siglock);
old_expires = timer->it.cpu.expires;
list_del_init(&timer->it.cpu.entry);
if (unlikely(timer->it.cpu.firing)) {
timer->it.cpu.firing = -1;
ret = TIMER_RETRY;
} else
list_del_init(&timer->it.cpu.entry);
spin_unlock(&p->sighand->siglock);

/*
Expand Down Expand Up @@ -780,16 +786,14 @@ int posix_cpu_timer_set(struct k_itimer *timer, int flags,
}
}

if (unlikely(timer->it.cpu.firing)) {
if (unlikely(ret)) {
/*
* We are colliding with the timer actually firing.
* Punt after filling in the timer's old value, and
* disable this firing since we are already reporting
* it as an overrun (thanks to bump_cpu_timer above).
*/
read_unlock(&tasklist_lock);
timer->it.cpu.firing = -1;
ret = TIMER_RETRY;
goto out;
}

Expand Down

0 comments on commit 599c3b2

Please sign in to comment.