diff options
Diffstat (limited to 'hurd/thread-cancel.c')
-rw-r--r-- | hurd/thread-cancel.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/hurd/thread-cancel.c b/hurd/thread-cancel.c index 81828457d5..85ba010407 100644 --- a/hurd/thread-cancel.c +++ b/hurd/thread-cancel.c @@ -1,5 +1,5 @@ /* 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 @@ -25,7 +25,7 @@ Cambridge, MA 02139, USA. */ /* 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, @@ -45,9 +45,9 @@ hurd_thread_cancel (thread_t thread) 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); @@ -59,7 +59,7 @@ hurd_thread_cancel (thread_t thread) /* 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); @@ -85,7 +85,7 @@ hurd_check_cancel (void) 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); |