* hurd/hurdexec.c (_hurd_exec): Use new critical section lock.
* hurd/catch-exc.c (_S_catch_exception_raise): Likewise.
* hurd/sigunwind.c (_hurdsig_longjmp_from_handler): Likewise.
* hurd/thread-cancel.c (hurd_thread_cancel, hurd_check_cancel):
Likewise.
* sysdeps/mach/hurd/jmp-unwind.c (_longjmp_unwind): Likewise.
* sysdeps/mach/hurd/sigaction.c: Likewise.
-/* Copyright (C) 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
no code should do anything that can fault while holding the
sigstate lock. */
- ss->critical_section = 0;
+ __spin_unlock (&ss->critical_section_lock);
ss->context = NULL;
__spin_unlock (&ss->lock);
}
__spin_lock (&ss->lock);
/* We should only ever be called from _longjmp_unwind (in jmp-unwind.c),
which calls us inside a critical section. */
- assert (ss->critical_section);
+ assert (__spin_lock_locked (&ss->critical_section_lock));
/* Are we on the alternate signal stack now? */
onstack = (ss->sigaltstack.ss_flags & SA_ONSTACK);
__spin_unlock (&ss->lock);
having run all the unwind forms back to ENV's frame, but our SP is
still inside those unwound frames. */
__spin_lock (&ss->lock);
- ss->critical_section = 0;
+ __spin_unlock (&ss->critical_section_lock);
ss->blocked = ~(sigset_t) 0 & ~_SIG_CANT_MASK;
__spin_unlock (&ss->lock);
/* Thread cancellation support.
-Copyright (C) 1995 Free Software Foundation, Inc.
+Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
/* See hurdsig.c. */
extern mach_port_t _hurdsig_abort_rpcs (struct hurd_sigstate *ss,
- int signo, int sigthread,
+ int signo, int sigthread,
struct machine_thread_all_state *,
int *state_change,
mach_port_t *reply_port,
if (ss == _hurd_self_sigstate ())
return EINTR; /* Bozo. */
+ assert (! __spin_lock_locked (&ss->critical_section_lock));
+ __spin_lock (&ss->critical_section_lock);
__spin_lock (&ss->lock);
- assert (! ss->critical_section);
- ss->critical_section = 1;
err = __thread_suspend (thread);
__spin_unlock (&ss->lock);
/* Interrupt any interruptible RPC now in progress. */
state.set = 0;
_hurdsig_abort_rpcs (ss, 0, 0, &state, &state_change, NULL, 0, 0);
- if (state_change)
+ if (state_change)
err = __thread_set_state (thread, MACHINE_THREAD_STATE_FLAVOR,
(natural_t *) &state.basic,
MACHINE_THREAD_STATE_COUNT);
int cancel;
__spin_lock (&ss->lock);
- assert (! ss->critical_section);
+ assert (! __spin_lock_locked (&ss->critical_section_lock));
cancel = ss->cancel;
ss->cancel = 0;
__spin_unlock (&ss->lock);
/* All access to SS->active_resources must take place inside a critical
section where signal handlers cannot run. */
__spin_lock (&ss->lock);
- assert (! ss->critical_section);
- ss->critical_section = 1;
+ assert (! __spin_lock_locked (&ss->critical_section_lock));
+ __spin_lock (&ss->critical_section_lock);
/* Remove local signal preempters being unwound past. */
while (ss->preempters &&
_JMPBUF_UNWINDS (env[0].__jmpbuf, ss->preempters))
ss->preempters = ss->preempters->next;
+ __spin_unlock (&ss->critical_section_lock);
__spin_unlock (&ss->lock);
/* Iterate over the current thread's list of active resources.
-/* Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
ss = _hurd_self_sigstate ();
+ __spin_lock (&ss->critical_section_lock);
__spin_lock (&ss->lock);
old = ss->actions[sig];
if (act != NULL)
if (act != NULL && sig == SIGCHLD &&
(a.sa_flags & SA_NOCLDSTOP) != (old.sa_flags & SA_NOCLDSTOP))
{
- ss->critical_section = 1;
__spin_unlock (&ss->lock);
/* Inform the proc server whether or not it should send us SIGCHLD for
__proc_mod_stopchild (port, !(a.sa_flags & SA_NOCLDSTOP)));
__spin_lock (&ss->lock);
- ss->critical_section = 0;
pending = ss->pending & ~ss->blocked;
}
else
pending = 0;
__spin_unlock (&ss->lock);
+ __spin_unlock (&ss->critical_section_lock);
if (pending)
- __msg_sig_post (_hurd_msgport, 0, __mach_task_self ());
+ __msg_sig_post (_hurd_msgport, 0, 0, __mach_task_self ());
if (oact != NULL)
*oact = old;