On Tue, 30 Apr 2002, Archie Cobbs wrote:
> Hi,
> Any comments positive or negative to the patch in bin/37614 ?
> I'd like to commit this soon...
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=37614
The patch is for stable, but would need to be applied to -current
first (after some adjustment).
Hmm, what about just bypassing the pthread_cancel() if the
thread is already in the process of exiting?
Index: uthread_cancel.c
===================================================================
RCS file: /opt/d/CVS/src/lib/libc_r/uthread/uthread_cancel.c,v
retrieving revision 1.12
diff -u -r1.12 uthread_cancel.c
--- uthread_cancel.c 6 Mar 2002 19:28:40 -0000 1.12
+++ uthread_cancel.c 1 May 2002 02:35:23 -0000
@@ -20,7 +20,8 @@
if ((ret = _find_thread(pthread)) != 0) {
/* NOTHING */
- } else if (pthread->state == PS_DEAD || pthread->state == PS_DEADLOCK) {
+ } else if (pthread->state == PS_DEAD || pthread->state == PS_DEADLOCK
+ || (pthread->flags & PTHREAD_EXITING) != 0) {
ret = 0;
} else {
/* Protect the scheduling queues: */
--
Dan Eischen
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-stable" in the body of the message