From patchwork Mon Feb 10 01:05:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1235581 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-109336-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=a4cgJJhd; 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 48G74Q1T42z9sRR for ; Mon, 10 Feb 2020 12:05:24 +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:in-reply-to :references:mime-version:content-transfer-encoding; q=dns; s= default; b=TzPE3J8DEVk0IWFnjn92q5D2cxFZDZTlMwDAgcU3M2cYyDJZGIPTC 0xsbI/Y/ioBmcREZRiuaqB5m/th0K7UHG8QPd1vvXYYw++iuClF6yTE87TVgLgSr dOCKa3wAYVgvAoPqS8z+9sbOBR4EYdjtjrv0wA6KLP2jQY+0yn7HYg= 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:in-reply-to :references:mime-version:content-transfer-encoding; s=default; bh=QEkuKGZtH8RAx9y4X1PwTAyBfh8=; b=a4cgJJhdFA3kgxx4Q5lSnTVRjhnW Q1/4UiDVq1glFl4RY6CoSDI5hnb3jX4CrltwI0fNRx4ef6tc5FbSMyFLszs6sI71 E/snI/Y6mKZEJGexpJOVLbnyVc5cYqXhJVfNdyZPrVy7TWBr2NpLdvJM+h3a/PIX JmNzzRD1VaMoapo= Received: (qmail 95833 invoked by alias); 10 Feb 2020 01:05:18 -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 95808 invoked by uid 89); 10 Feb 2020 01:05:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.1 spammy=H*MI:sk:2020021, HContent-Transfer-Encoding:8bit X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd,commited 09/10] htl: Fix barrier_wait with one thread Date: Mon, 10 Feb 2020 02:05:07 +0100 Message-Id: <20200210010508.428251-9-samuel.thibault@ens-lyon.org> In-Reply-To: <20200210010508.428251-1-samuel.thibault@ens-lyon.org> References: <20200210010508.428251-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 --- sysdeps/htl/pt-barrier-wait.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sysdeps/htl/pt-barrier-wait.c b/sysdeps/htl/pt-barrier-wait.c index 47ec440b26..146605abd8 100644 --- a/sysdeps/htl/pt-barrier-wait.c +++ b/sysdeps/htl/pt-barrier-wait.c @@ -29,7 +29,9 @@ pthread_barrier_wait (pthread_barrier_t *barrier) { barrier->__pending = barrier->__count; - if (barrier->__count > 1) + if (barrier->__count == 1) + __pthread_spin_unlock (&barrier->__lock); + else { struct __pthread *wakeup; unsigned n = 0;