Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10016
b: refs/heads/master
c: e03d13e
h: refs/heads/master
v: v3
  • Loading branch information
Roland McGrath authored and Linus Torvalds committed Oct 20, 2005
1 parent a91e221 commit 1f70984
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 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: 3359b54c8c07338f3a863d1109b42eebccdcf379
refs/heads/master: e03d13e985d48ac4885382c9e3b1510c78bd047f
28 changes: 11 additions & 17 deletions trunk/kernel/posix-cpu-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,25 +387,19 @@ int posix_cpu_timer_del(struct k_itimer *timer)
if (unlikely(p == NULL))
return 0;

spin_lock(&p->sighand->siglock);
if (!list_empty(&timer->it.cpu.entry)) {
read_lock(&tasklist_lock);
if (unlikely(p->signal == NULL)) {
/*
* We raced with the reaping of the task.
* The deletion should have cleared us off the list.
*/
BUG_ON(!list_empty(&timer->it.cpu.entry));
} else {
/*
* Take us off the task's timer list.
*/
spin_lock(&p->sighand->siglock);
list_del(&timer->it.cpu.entry);
spin_unlock(&p->sighand->siglock);
}
read_unlock(&tasklist_lock);
/*
* Take us off the task's timer list. We don't need to
* take tasklist_lock and check for the task being reaped.
* If it was reaped, it already called posix_cpu_timers_exit
* and posix_cpu_timers_exit_group to clear all the timers
* that pointed to it.
*/
list_del(&timer->it.cpu.entry);
put_task_struct(p);
}
put_task_struct(p);
spin_unlock(&p->sighand->siglock);

return 0;
}
Expand Down

0 comments on commit 1f70984

Please sign in to comment.