Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7393
b: refs/heads/master
c: e752dd6
h: refs/heads/master
i:
  7391: f6f16c1
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Sep 7, 2005
1 parent aeaa781 commit b7796c5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 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: a97c9bf33f4612e2aed6f000f6b1d268b6814f3c
refs/heads/master: e752dd6cc66a3e6a11396928998baf390cc00420
28 changes: 15 additions & 13 deletions trunk/kernel/posix-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,21 +427,23 @@ int posix_timer_event(struct k_itimer *timr,int si_private)
timr->sigq->info.si_code = SI_TIMER;
timr->sigq->info.si_tid = timr->it_id;
timr->sigq->info.si_value = timr->it_sigev_value;

if (timr->it_sigev_notify & SIGEV_THREAD_ID) {
if (unlikely(timr->it_process->flags & PF_EXITING)) {
timr->it_sigev_notify = SIGEV_SIGNAL;
put_task_struct(timr->it_process);
timr->it_process = timr->it_process->group_leader;
goto group;
}
return send_sigqueue(timr->it_sigev_signo, timr->sigq,
timr->it_process);
}
else {
group:
return send_group_sigqueue(timr->it_sigev_signo, timr->sigq,
timr->it_process);
struct task_struct *leader;
int ret = send_sigqueue(timr->it_sigev_signo, timr->sigq,
timr->it_process);

if (likely(ret >= 0))
return ret;

timr->it_sigev_notify = SIGEV_SIGNAL;
leader = timr->it_process->group_leader;
put_task_struct(timr->it_process);
timr->it_process = leader;
}

return send_group_sigqueue(timr->it_sigev_signo, timr->sigq,
timr->it_process);
}
EXPORT_SYMBOL_GPL(posix_timer_event);

Expand Down
22 changes: 12 additions & 10 deletions trunk/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,16 +1366,16 @@ send_sigqueue(int sig, struct sigqueue *q, struct task_struct *p)
unsigned long flags;
int ret = 0;

/*
* We need the tasklist lock even for the specific
* thread case (when we don't need to follow the group
* lists) in order to avoid races with "p->sighand"
* going away or changing from under us.
*/
BUG_ON(!(q->flags & SIGQUEUE_PREALLOC));
read_lock(&tasklist_lock);
read_lock(&tasklist_lock);

if (unlikely(p->flags & PF_EXITING)) {
ret = -1;
goto out_err;
}

spin_lock_irqsave(&p->sighand->siglock, flags);

if (unlikely(!list_empty(&q->list))) {
/*
* If an SI_TIMER entry is already queue just increment
Expand All @@ -1385,7 +1385,7 @@ send_sigqueue(int sig, struct sigqueue *q, struct task_struct *p)
BUG();
q->info.si_overrun++;
goto out;
}
}
/* Short-circuit ignored signals. */
if (sig_ignored(p, sig)) {
ret = 1;
Expand All @@ -1400,8 +1400,10 @@ send_sigqueue(int sig, struct sigqueue *q, struct task_struct *p)

out:
spin_unlock_irqrestore(&p->sighand->siglock, flags);
out_err:
read_unlock(&tasklist_lock);
return(ret);

return ret;
}

int
Expand Down

0 comments on commit b7796c5

Please sign in to comment.