From: Samuel Thibault Date: Mon, 10 Feb 2020 12:22:31 +0000 (+0100) Subject: htl: Avoid a local plt for pthread_self X-Git-Tag: glibc-2.32~693 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1433e270a16442ae9a86dc749d9cbd5e1f55405d;p=thirdparty%2Fglibc.git htl: Avoid a local plt for pthread_self --- diff --git a/htl/pt-join.c b/htl/pt-join.c index ab77af52c1c..ecb79e7c494 100644 --- a/htl/pt-join.c +++ b/htl/pt-join.c @@ -30,14 +30,14 @@ __pthread_join (pthread_t thread, void **status) struct __pthread *pthread; int err = 0; - if (thread == pthread_self ()) - return EDEADLK; - /* Lookup the thread structure for THREAD. */ pthread = __pthread_getid (thread); if (pthread == NULL) return ESRCH; + if (pthread == _pthread_self ()) + return EDEADLK; + __pthread_mutex_lock (&pthread->state_lock); pthread_cleanup_push ((void (*)(void *)) __pthread_mutex_unlock, &pthread->state_lock);