]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
htl: Avoid a local plt for pthread_self
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 10 Feb 2020 12:22:31 +0000 (13:22 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 10 Feb 2020 12:22:56 +0000 (13:22 +0100)
htl/pt-join.c

index ab77af52c1c3662a28e3471e2ca4f6dfd7dc9e85..ecb79e7c4947e82d2320f473fe02f39f28e47937 100644 (file)
@@ -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);