Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpthread pthread_join(): add a temporary hack to make ...



details:   https://anonhg.NetBSD.org/src/rev/33c9171cccbf
branches:  trunk
changeset: 744247:33c9171cccbf
user:      ad <ad%NetBSD.org@localhost>
date:      Tue Jan 28 09:23:15 2020 +0000

description:
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).

diffstat:

 lib/libpthread/pthread.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r c5137a9aeeeb -r 33c9171cccbf lib/libpthread/pthread.c
--- a/lib/libpthread/pthread.c  Tue Jan 28 08:09:19 2020 +0000
+++ b/lib/libpthread/pthread.c  Tue Jan 28 09:23:15 2020 +0000
@@ -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 @@
        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);



Home | Main Index | Thread Index | Old Index