summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/uthread/uthread_detach.c
diff options
context:
space:
mode:
authorfgsch <fgsch@openbsd.org>2002-03-07 22:36:03 +0000
committerfgsch <fgsch@openbsd.org>2002-03-07 22:36:03 +0000
commit1d4de188ca52ee13dba915553dcd5903486237b5 (patch)
tree423b88d0cc77000e99a0cceba119989f31e12935 /lib/libpthread/uthread/uthread_detach.c
parentAdd descriptions of BUS_DMA_READ, BUS_DMA_WRITE, and BUS_DMA_STREAMING (diff)
downloadwireguard-openbsd-1d4de188ca52ee13dba915553dcd5903486237b5.tar.xz
wireguard-openbsd-1d4de188ca52ee13dba915553dcd5903486237b5.zip
From FreeBSD:
Properly clear the status of a join operation if the joining thread is canceled or the joinee is detached.
Diffstat (limited to 'lib/libpthread/uthread/uthread_detach.c')
-rw-r--r--lib/libpthread/uthread/uthread_detach.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libpthread/uthread/uthread_detach.c b/lib/libpthread/uthread/uthread_detach.c
index 786df9d165c..92d41efedc4 100644
--- a/lib/libpthread/uthread/uthread_detach.c
+++ b/lib/libpthread/uthread/uthread_detach.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_detach.c,v 1.7 2001/12/11 00:19:47 fgsch Exp $ */
+/* $OpenBSD: uthread_detach.c,v 1.8 2002/03/07 22:36:03 fgsch Exp $ */
/*
* Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>.
* All rights reserved.
@@ -66,7 +66,9 @@ pthread_detach(pthread_t pthread)
PTHREAD_NEW_STATE(joiner, PS_RUNNING);
/* Set the return value for the woken thread: */
- joiner->error = ESRCH;
+ joiner->join_status.error = ESRCH;
+ joiner->join_status.ret = NULL;
+ joiner->join_status.thread = NULL;
/*
* Disconnect the joiner from the thread being detached: