In pthread_exit(), clear pt_canceled in addition to setting
PT_FLAG_CS_DISABLED in pt_flags. Prevents cancellation cleanup handlers from thinking that they've been canceled and exiting mid-handler. Problem spotted by Matt Thomas.
This commit is contained in:
parent
416cebb2dc
commit
66fcc1ce38
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pthread.c,v 1.9 2003/02/15 04:34:40 nathanw Exp $ */
|
||||
/* $NetBSD: pthread.c,v 1.10 2003/02/22 00:53:29 nathanw Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||
|
@ -355,6 +355,7 @@ pthread_exit(void *retval)
|
|||
|
||||
/* Disable cancellability. */
|
||||
self->pt_flags |= PT_FLAG_CS_DISABLED;
|
||||
self->pt_cancel = 0;
|
||||
|
||||
/* Call any cancellation cleanup handlers */
|
||||
while (!PTQ_EMPTY(&self->pt_cleanup_stack)) {
|
||||
|
|
Loading…
Reference in New Issue