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(): remove temporary hack now k...



details:   https://anonhg.NetBSD.org/src/rev/f303406cae6d
branches:  trunk
changeset: 744323:f303406cae6d
user:      ad <ad%NetBSD.org@localhost>
date:      Wed Jan 29 17:11:57 2020 +0000

description:
- pthread_join(): remove temporary hack now kernel returns correct errno.

- kill(getpid(), SIGABRT)  ->  _lwp_kill(_lwp_self(), SIGABRT)

diffstat:

 lib/libpthread/pthread.c |  13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diffs (48 lines):

diff -r df9946c9dccf -r f303406cae6d lib/libpthread/pthread.c
--- a/lib/libpthread/pthread.c  Wed Jan 29 16:34:09 2020 +0000
+++ b/lib/libpthread/pthread.c  Wed Jan 29 17:11:57 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread.c,v 1.161 2020/01/29 16:03:44 kamil Exp $      */
+/*     $NetBSD: pthread.c,v 1.162 2020/01/29 17:11:57 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.161 2020/01/29 16:03:44 kamil Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.162 2020/01/29 17:11:57 ad Exp $");
 
 #define        __EXPOSE_STACK  1
 
@@ -719,10 +719,6 @@
        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);
@@ -1101,8 +1097,7 @@
            function ? "\"" : "");
 
        _sys_write(STDERR_FILENO, buf, (size_t)len);
-       (void)kill(getpid(), SIGABRT);
-
+       (void)_lwp_kill(_lwp_self(), SIGABRT);
        _exit(1);
 }
 
@@ -1137,7 +1132,7 @@
                syslog(LOG_DEBUG | LOG_USER, "%s", buf);
 
        if (pthread__diagassert & DIAGASSERT_ABORT) {
-               (void)kill(getpid(), SIGABRT);
+               (void)_lwp_kill(_lwp_self(), SIGABRT);
                _exit(1);
        }
 }



Home | Main Index | Thread Index | Old Index