Source-Changes-HG archive

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

[src/trunk]: src/lib/libpthread Remove 'ifdef 0' hacks



details:   https://anonhg.NetBSD.org/src/rev/53e9b7b27c70
branches:  trunk
changeset: 744445:53e9b7b27c70
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sat Feb 01 15:39:56 2020 +0000

description:
Remove 'ifdef 0' hacks

It is no longer needed as the proper fix avoiding premature malloc()
landed the sources.

diffstat:

 lib/libpthread/pthread_mutex.c |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (45 lines):

diff -r 51048310251f -r 53e9b7b27c70 lib/libpthread/pthread_mutex.c
--- a/lib/libpthread/pthread_mutex.c    Sat Feb 01 15:38:46 2020 +0000
+++ b/lib/libpthread/pthread_mutex.c    Sat Feb 01 15:39:56 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread_mutex.c,v 1.72 2020/01/31 17:52:14 kamil Exp $ */
+/*     $NetBSD: pthread_mutex.c,v 1.73 2020/02/01 15:39:56 kamil 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.72 2020/01/31 17:52:14 kamil Exp $");
+__RCSID("$NetBSD: pthread_mutex.c,v 1.73 2020/02/01 15:39:56 kamil Exp $");
 
 #include <sys/types.h>
 #include <sys/lwpctl.h>
@@ -122,14 +122,12 @@
 {
        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
 
        pthread__error(EINVAL, "Invalid mutes attribute",
            attr == NULL || attr->ptma_magic == _PT_MUTEXATTR_MAGIC);
@@ -619,10 +617,9 @@
 int
 pthread_mutexattr_init(pthread_mutexattr_t *attr)
 {
-#if 0
+
        if (__predict_false(__uselibcstub))
                return __libc_mutexattr_init_stub(attr);
-#endif
 
        attr->ptma_magic = _PT_MUTEXATTR_MAGIC;
        attr->ptma_private = (void *)PTHREAD_MUTEX_DEFAULT;



Home | Main Index | Thread Index | Old Index