From patchwork Mon Feb 10 12:23:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1235801 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-109356-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha1 header.s=default header.b=cPmekbjR; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48GQ8x0Qlqz9sPK for ; Mon, 10 Feb 2020 23:25:20 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; q=dns; s=default; b=xzr UiQBH22KoImQa+cicc7VdFNyebZsGSiK/9XmB97nOhmERmX422CiJ0QEMgHdDqV4 mVUDP9daGP4MqHNv9WidYATl4Y79Np5CI9DOQAurn4in/XT8Ih1TplqiLgHpQDXO XPgvppTieXCqMuTXsTEGLM6NDNT5WKBZf5TvJjPM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=default; bh=T1jlBaUz1 3RZ6f71KO3bJLvj3o8=; b=cPmekbjR/y7Pkz3KuBclDHNKYDzJlWnzTbeaAGeh+ BIt7KjABOFQ6SakIzgQwXVpZHsuLnW0s1E43gFGy+2oJ2FeoAdmbCiZlbR+UGSue FWqVNGg6d7SO8zUKflbS/9hp5XsYri1jPgKe/DJTqCCpVT2PccPPEBxG/0U/yd9U yg= Received: (qmail 44472 invoked by alias); 10 Feb 2020 12:25:01 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 44290 invoked by uid 89); 10 Feb 2020 12:24:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_NEUTRAL autolearn=ham version=3.3.1 spammy=HX-Languages-Length:733, HContent-Transfer-Encoding:8bit X-HELO: mail2-relais-roc.national.inria.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd,commited] htl: Avoid a local plt for pthread_self Date: Mon, 10 Feb 2020 13:23:35 +0100 Message-Id: <20200210122335.131334-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 --- htl/pt-join.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htl/pt-join.c b/htl/pt-join.c index ab77af52c1..ecb79e7c49 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);