From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id WsIPCcuwmGkIFgMAWB0awg (envelope-from ) for ; Fri, 20 Feb 2026 14:06:51 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=CgUlemfp; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E0A471E08D; Fri, 20 Feb 2026 14:06:50 -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.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,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 06D491E08D for ; Fri, 20 Feb 2026 14:06:50 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 659A54B9DB57 for ; Fri, 20 Feb 2026 19:06:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 659A54B9DB57 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=CgUlemfp Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id 7E11A4BA23FA for ; Fri, 20 Feb 2026 19:06:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7E11A4BA23FA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7E11A4BA23FA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771614382; cv=none; b=KnIYfzXVFdy/mu+2wYSeYjb40p89aYSHML0G9dW9PIU93paVXc6Ip/XAOUBGx9yr+Pd2GrLzZF4DpuMgeocjeP/xUONPfaECJuTp4vX/xJRltXmeGl3GI5XDFwEy8o41WWPjA0QukTUJ0RISVtnnFx0O3DxOXqzFzXVzU+ofUWU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771614382; c=relaxed/simple; bh=cIerBMoWUmN576S95eIutbUFrSNareYdEOAwv9EGJII=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=glPbz9W80q4UC56fs1+v0a8jJarDWTiJWfvPL2wcK4E9p336I45ilyWe/9l2a+xezMJFfgL7WJbAD9A42X9we6yMqoYPVyd+4fLIpREbHJCkd6kqtR9/w2KuZMvngwQAjWvwGywDRleO1LFT8jK17ZyGcMLY0LVN47HKbpj9wAU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E11A4BA23FA Received: from eig-obgw-5004b.ext.cloudfilter.net ([10.0.29.208]) by cmsmtp with ESMTPS id tSaRvI7HeSkcftVpWvYXK2; Fri, 20 Feb 2026 19:06:22 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id tVp6vDUk3qfpWtVp6vY3ln; Fri, 20 Feb 2026 19:05:56 +0000 X-Authority-Analysis: v=2.4 cv=A55sP7WG c=1 sm=1 tr=0 ts=6998b0ae a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=HzLeVaNsDn8A:10 a=ItBw4LHWJt0A:10 a=_ZhYKdCeAAAA:8 a=zstS-IiYAAAA:8 a=7bTf-GZXCtOevcuDb8sA:9 a=uqOk3ZSnBfCTOznnrPA1:22 a=4G6NA9xxw8l3yy4pmD5M:22 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=cDuPc0iQ33Gczd46GXEBi2ceWdPPNFxICYpK7ARHNmM=; b=CgUlemfpuUVawxIjhstedZL2BP wQ7Jz/nOjuXmDZgcMSArJrSICgs3D3ySxZlVm5Kc0uW+Iny4w2NRB8YS1K+1ikaW4AJ8MI6WLCQ08 go+XseVbaI5Aj7LEtaivLf7r2; Received: from 97-122-122-234.hlrn.qwest.net ([97.122.122.234]:40316 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vtVp5-00000003H0J-3KOC; Fri, 20 Feb 2026 12:05:55 -0700 From: Tom Tromey To: simon.marchi@polymtl.ca Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] gdb/testsuite: fix race condition in gdb.replay/missing-thread.c In-Reply-To: <20260206175807.631814-1-simon.marchi@polymtl.ca> (simon marchi's message of "Fri, 6 Feb 2026 12:57:56 -0500") References: <20260206175807.631814-1-simon.marchi@polymtl.ca> X-Attribution: Tom Date: Fri, 20 Feb 2026 12:05:54 -0700 Message-ID: <87cy1z1bhp.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.122.234 X-Source-L: No X-Exim-ID: 1vtVp5-00000003H0J-3KOC X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-122-234.hlrn.qwest.net (bapiya) [97.122.122.234]:40316 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfD7OKV8iZXl4NYonOq3YqII/zXEutODFjQ2YhF5ce5Vxob2bUV77KuxJ1jMq2eustkk9JM2JiJczu4jgkeJDBHEH+3JU1YR7MB4HKhNKOEsWOFXVrroo wbKXi6740Ioyn38a8jpHVbfhsg7O2rGgmxz0Ac2oR+rJZKaMjCRx1yHBAnWFJVyscNUsfvqvBrOGds03dL7MiIrXPK6bLZ9b8ZQ= 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 >>>>> "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