summaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 105bb8b1c..5077115ce 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -30,7 +30,7 @@
static kmem_cache_t *signal_queue_cachep;
-int nr_queued_signals;
+atomic_t nr_queued_signals;
int max_queued_signals = 1024;
void __init signals_init(void)
@@ -61,7 +61,7 @@ flush_signals(struct task_struct *t)
while (q) {
n = q->next;
kmem_cache_free(signal_queue_cachep, q);
- nr_queued_signals--;
+ atomic_dec(&nr_queued_signals);
q = n;
}
}
@@ -158,7 +158,7 @@ printk("SIG dequeue (%s:%d): %d ", current->comm, current->pid,
current->sigqueue_tail = pp;
*info = q->info;
kmem_cache_free(signal_queue_cachep,q);
- nr_queued_signals--;
+ atomic_dec(&nr_queued_signals);
/* then see if this signal is still pending. */
q = *pp;
@@ -324,13 +324,13 @@ printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
struct signal_queue *q = 0;
- if (nr_queued_signals < max_queued_signals) {
+ if (atomic_read(&nr_queued_signals) < max_queued_signals) {
q = (struct signal_queue *)
kmem_cache_alloc(signal_queue_cachep, GFP_ATOMIC);
}
if (q) {
- nr_queued_signals++;
+ atomic_inc(&nr_queued_signals);
q->next = NULL;
*t->sigqueue_tail = q;
t->sigqueue_tail = &q->next;
@@ -873,7 +873,7 @@ do_sigaction(int sig, const struct k_sigaction *act, struct k_sigaction *oact)
else {
*pp = q->next;
kmem_cache_free(signal_queue_cachep, q);
- nr_queued_signals--;
+ atomic_dec(&nr_queued_signals);
}
q = *pp;
}