Source-Changes-HG archive

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

[src/trunk]: src/lib/libpthread Jemalloc initializes mutexes before we become...



details:   https://anonhg.NetBSD.org/src/rev/763df73df519
branches:  trunk
changeset: 997390:763df73df519
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Mar 05 22:49:38 2019 +0000

description:
Jemalloc initializes mutexes before we become threaded and expects to use
them later.

diffstat:

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

diffs (33 lines):

diff -r 74ac1fa1ad87 -r 763df73df519 lib/libpthread/pthread_mutex.c
--- a/lib/libpthread/pthread_mutex.c    Tue Mar 05 22:45:11 2019 +0000
+++ b/lib/libpthread/pthread_mutex.c    Tue Mar 05 22:49:38 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread_mutex.c,v 1.64 2017/12/08 09:24:31 kre Exp $   */
+/*     $NetBSD: pthread_mutex.c,v 1.65 2019/03/05 22:49:38 christos Exp $      */
 
 /*-
  * Copyright (c) 2001, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_mutex.c,v 1.64 2017/12/08 09:24:31 kre Exp $");
+__RCSID("$NetBSD: pthread_mutex.c,v 1.65 2019/03/05 22:49:38 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/lwpctl.h>
@@ -122,8 +122,14 @@
 {
        uintptr_t type, proto, val, ceil;
 
+#if 0
+       /*
+        * Always initialize the mutex structure, maybe be used later
+        * and the cost should be minimal.
+        */
        if (__predict_false(__uselibcstub))
                return __libc_mutex_init_stub(ptm, attr);
+#endif
 
        if (attr == NULL) {
                type = PTHREAD_MUTEX_NORMAL;



Home | Main Index | Thread Index | Old Index