From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YUgfKce5mGmmHwMAWB0awg (envelope-from ) for ; Fri, 20 Feb 2026 14:45:11 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=W6NEFoeH; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 983AA1E0BA; Fri, 20 Feb 2026 14:45:11 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4AD361E08D for ; Fri, 20 Feb 2026 14:45:10 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id BFDBF4B9DB7B for ; Fri, 20 Feb 2026 19:45:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BFDBF4B9DB7B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=W6NEFoeH Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id AFF714BA2E18 for ; Fri, 20 Feb 2026 19:44:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AFF714BA2E18 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AFF714BA2E18 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771616678; cv=none; b=gBjZb0hn6KkhE79PM2tCJTJYCEjWOFJHKfLsjWC+NjzhBePr+PqlHuxGYlFXUCpe16EYSuZekFjmta4YLs7AHAC+ruR3ylt5Rjmqu4sRsE563GuWrhmG8dJZyw+OT8ogfu6AlL20sOLHzEoHUtmhxVn7kkSNHj2SI1eScYMle3k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771616678; c=relaxed/simple; bh=q1t0ejC9x3bhvool7XDUwVU0iBS/zgUdkTHf3RGNcCI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Cd/XhhU5EN1ywTjdvzAJb3KHhnOrYr4sZAG+kQ7KzhinYo51QvalaC4mu+2jVzLp+gPpzE355NeGwKJHkXOLl4wzaVOYPuMEDKyZ9cIg1L7Cj/aXSfxuWE0YrJRqaigIM0wawMCBfw5FjF2+/Y/+21mulMjzmAom/Ixp3Duy+ew= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AFF714BA2E18 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 61KJiXTZ113073 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Feb 2026 14:44:37 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 61KJiXTZ113073 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1771616678; bh=xmIPgFn2CuX0cf6WJSEZzyl1k8kEpl/ENgEx37wOKkU=; h=Date:Subject:To:Cc:From:In-Reply-To:From; b=W6NEFoeHrzTUdgzfTd2/IlI7UbRwPfYgC49ZAxNnggFnujAyCk5tjglucZHfS6FIG 0dHoM1AVd17eAyUCGsnGPrE76rd2pnetWIE+cNXDgAf9QaOtdSnIsVp9EkGxp/44Ow /G+2ADEvDqZNYWU+X8TKxjv+mjnPAdCCuMyE4rFMCtr5iVG8Sbz15JjTsXTjL3gto/ zyM9XAKK8Z8RigK6cev3Zav0GPCdTQ0PdcY/YdaamjSznJMs+ksuS3py3C5oJiTBzE 9myUCENLrxWsl3daA9/R8g+ONvB3tkOb6Vn34PgLla6DkefHxYzEEAbWN7GAao+bjn 7EjWl8ktxthUA== Received: by simark.ca (Postfix) id 8099F1E08D; Fri, 20 Feb 2026 14:44:32 -0500 (EST) Message-ID: Date: Fri, 20 Feb 2026 14:44:31 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdb/testsuite: fix race condition in gdb.replay/missing-thread.c To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20260206175807.631814-1-simon.marchi@polymtl.ca> <87cy1z1bhp.fsf@tromey.com> Content-Language: fr From: Simon Marchi In-Reply-To: <87cy1z1bhp.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 20 Feb 2026 19:44:33 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 2/20/26 2:05 PM, Tom Tromey wrote: >>>>>> "Simon" == simon marchi writes: > > Simon> Fix it by introducing a separate boolean predicate protected by the > Simon> shared mutex, and looping until it is true. This is the way > Simon> pthread_cond_wait is meant to be used. From pthread_cond_wait(3): > > Thanks. > > Simon> + pthread_mutex_lock (&g_mutex); > Simon> + g_ready = true; > Simon> + pthread_mutex_unlock (&g_mutex); > Simon> pthread_cond_signal (&g_condvar); > > I looked into this and TIL it's fine to pthread_cond_signal without > holding the lock. > > Approved-By: Tom Tromey > > Tom Thanks, this will make my CI jobs much happier. Pushed. Simon