Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 64636
b: refs/heads/master
c: 60187d2
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Aug 31, 2007
1 parent 453a51b commit f1acb81
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 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: 99db67bc04af0f2e8cb710ac92aaeb9af135a7c6
refs/heads/master: 60187d2708caa870f0825d753df1612ea688eb9e
19 changes: 9 additions & 10 deletions trunk/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1300,20 +1300,19 @@ struct sigqueue *sigqueue_alloc(void)
void sigqueue_free(struct sigqueue *q)
{
unsigned long flags;
spinlock_t *lock = &current->sighand->siglock;

BUG_ON(!(q->flags & SIGQUEUE_PREALLOC));
/*
* If the signal is still pending remove it from the
* pending queue.
* pending queue. We must hold ->siglock while testing
* q->list to serialize with collect_signal().
*/
if (unlikely(!list_empty(&q->list))) {
spinlock_t *lock = &current->sighand->siglock;
read_lock(&tasklist_lock);
spin_lock_irqsave(lock, flags);
if (!list_empty(&q->list))
list_del_init(&q->list);
spin_unlock_irqrestore(lock, flags);
read_unlock(&tasklist_lock);
}
spin_lock_irqsave(lock, flags);
if (!list_empty(&q->list))
list_del_init(&q->list);
spin_unlock_irqrestore(lock, flags);

q->flags &= ~SIGQUEUE_PREALLOC;
__sigqueue_free(q);
}
Expand Down

0 comments on commit f1acb81

Please sign in to comment.