From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87910 invoked by alias); 10 Jul 2015 17:59:45 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 86905 invoked by uid 89); 10 Jul 2015 17:59:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.0 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Date: Fri, 10 Jul 2015 17:59:00 -0000 From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Subject: [COMMITTED PATCH] Remove unnecessary mutex locks from tst-tls-atexit test case Message-ID: <20150710175938.GA13665@spoyarek.pnq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-07/txt/msg00340.txt.bz2 The locks don't synchronize with anything - they were likely introduced initially to synchronize with some main thread code, but that is no longer evident. Committed as obvious. Siddhesh --- ChangeLog | 3 +++ stdlib/tst-tls-atexit.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ee61d6..0c7fc2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-07-10 Siddhesh Poyarekar + * stdlib/tst-tls-atexit.c (load): Remove unnecessary mutex + locks. + * stdlib/tst-tls-atexit.c (load): Avoid boolean coercion. 2015-07-10 Torvald Riegel diff --git a/stdlib/tst-tls-atexit.c b/stdlib/tst-tls-atexit.c index 7a69722..5ee04a8 100644 --- a/stdlib/tst-tls-atexit.c +++ b/stdlib/tst-tls-atexit.c @@ -29,12 +29,10 @@ #include void *handle; -pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; void * load (void *u) { - pthread_mutex_lock (&m); handle = dlopen ("$ORIGIN/tst-tls-atexit-lib.so", RTLD_LAZY); if (handle == NULL) { @@ -55,7 +53,6 @@ load (void *u) /* This should not unload the DSO. If it does, then the thread exit will result in a segfault. */ dlclose (handle); - pthread_mutex_unlock (&m); return NULL; } -- 2.4.3