summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-06-03 07:28:06 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-06-03 07:28:06 +0000
commitedb5c61526e98426a5f3da889463c2b8d85d04c0 (patch)
tree27965970d5fe47655e451ef3251cc20df75e04b7 /kernel
parent2e6827eb279d02923bf12eb0cfc077b26f545953 (diff)
Sync with Linux 2.1.41
Diffstat (limited to 'kernel')
-rw-r--r--kernel/exit.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 3fce2a2d7..88e012ba3 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -33,6 +33,7 @@ int getrusage(struct task_struct *, int, struct rusage *);
static inline void generate(unsigned long sig, struct task_struct * p)
{
+ unsigned flags;
unsigned long mask = 1 << (sig-1);
struct sigaction * sa = sig + p->sig->action - 1;
@@ -41,7 +42,7 @@ static inline void generate(unsigned long sig, struct task_struct * p)
* be handled immediately (ie non-blocked and untraced)
* and that is ignored (either explicitly or by default)
*/
- spin_lock_irq(&p->sig->siglock);
+ spin_lock_irqsave(&p->sig->siglock, flags);
if (!(mask & p->blocked) && !(p->flags & PF_PTRACED)) {
/* don't bother with ignored signals (but SIGCHLD is special) */
if (sa->sa_handler == SIG_IGN && sig != SIGCHLD)
@@ -57,7 +58,7 @@ static inline void generate(unsigned long sig, struct task_struct * p)
if (p->state == TASK_INTERRUPTIBLE && (p->signal & ~p->blocked))
wake_up_process(p);
out:
- spin_unlock_irq(&p->sig->siglock);
+ spin_unlock_irqrestore(&p->sig->siglock, flags);
}
/*
@@ -68,10 +69,11 @@ void force_sig(unsigned long sig, struct task_struct * p)
{
sig--;
if (p->sig) {
+ unsigned flags;
unsigned long mask = 1UL << sig;
struct sigaction *sa = p->sig->action + sig;
- spin_lock_irq(&p->sig->siglock);
+ spin_lock_irqsave(&p->sig->siglock, flags);
spin_lock(&p->sigmask_lock);
p->signal |= mask;
@@ -83,7 +85,7 @@ void force_sig(unsigned long sig, struct task_struct * p)
if (p->state == TASK_INTERRUPTIBLE)
wake_up_process(p);
- spin_unlock_irq(&p->sig->siglock);
+ spin_unlock_irqrestore(&p->sig->siglock, flags);
}
}
@@ -98,7 +100,8 @@ int send_sig(unsigned long sig,struct task_struct * p,int priv)
return -EPERM;
if (sig && p->sig) {
- spin_lock_irq(&p->sigmask_lock);
+ unsigned flags;
+ spin_lock_irqsave(&p->sigmask_lock, flags);
if ((sig == SIGKILL) || (sig == SIGCONT)) {
if (p->state == TASK_STOPPED)
wake_up_process(p);
@@ -108,7 +111,7 @@ int send_sig(unsigned long sig,struct task_struct * p,int priv)
}
if (sig == SIGSTOP || sig == SIGTSTP || sig == SIGTTIN || sig == SIGTTOU)
p->signal &= ~(1<<(SIGCONT-1));
- spin_unlock_irq(&p->sigmask_lock);
+ spin_unlock_irqrestore(&p->sigmask_lock, flags);
/* Actually generate the signal */
generate(sig,p);