Module Name: src Committed By: ad Date: Tue Jan 28 09:23:15 UTC 2020
Modified Files: src/lib/libpthread: pthread.c Log Message: pthread_join(): add a temporary hack to make lib/libpthread/t_detach pass. The correct fix is to do this in kernel (I have that change, but it's part of the wider change to index LWPs in a tree). To generate a diff of this commit: cvs rdiff -u -r1.157 -r1.158 src/lib/libpthread/pthread.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libpthread/pthread.c diff -u src/lib/libpthread/pthread.c:1.157 src/lib/libpthread/pthread.c:1.158 --- src/lib/libpthread/pthread.c:1.157 Mon Jan 27 20:50:05 2020 +++ src/lib/libpthread/pthread.c Tue Jan 28 09:23:15 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pthread.c,v 1.157 2020/01/27 20:50:05 ad Exp $ */ +/* $NetBSD: pthread.c,v 1.158 2020/01/28 09:23:15 ad Exp $ */ /*- * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008, 2020 @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: pthread.c,v 1.157 2020/01/27 20:50:05 ad Exp $"); +__RCSID("$NetBSD: pthread.c,v 1.158 2020/01/28 09:23:15 ad Exp $"); #define __EXPOSE_STACK 1 @@ -713,6 +713,10 @@ pthread_join(pthread_t thread, void **va if (thread == self) return EDEADLK; + /* XXX temporary - kernel should handle. */ + if ((thread->pt_flags & PT_FLAG_DETACHED) != 0) + return EINVAL; + /* IEEE Std 1003.1 says pthread_join() never returns EINTR. */ for (;;) { pthread__testcancel(self);