From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id 94B4B3858D20 for ; Tue, 20 Feb 2024 15:52:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 94B4B3858D20 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 94B4B3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708444322; cv=none; b=XrLI3SEVNSOg9MWaHG+mQznFRnOQ6HnFkHShdrt5dggD427t/CSImuUoH10Oo/VqL262Kw87yf3GjzhJjpK3MmkB8f1mHrzy6ibMcHGKNtQTt6S+NUSz7kV50/61k6l+UgjJZIMq5Mc5d677o1EnDMA1ChVBy6oy4e7pOWxs7GY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708444322; c=relaxed/simple; bh=7yVDDjk2VrzlD18Ug2ukKDb1PhdUVfIqOrmgSRJ/qD8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=joO9POgNDTNKaO53ttNGtZHxRFUbP80PKmwEtjj/jMxALnQj448MO3CL9HOYGDD7Xru5XT0X8M7DjUa3zbkVl6DwpWYB4lgZT90QGShXsvsSY16GTyMVo5W4m2690sveS/cs92hqwuB4DJuErioSnlMyjdYNRPfF1luUk442bfY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5006a.ext.cloudfilter.net ([10.0.29.179]) by cmsmtp with ESMTPS id cRFKrJs82THHucSPYr2dIg; Tue, 20 Feb 2024 15:52:00 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id cSPXruAZEUEmbcSPXrEvl8; Tue, 20 Feb 2024 15:52:00 +0000 X-Authority-Analysis: v=2.4 cv=MJnDm9Zl c=1 sm=1 tr=0 ts=65d4caa0 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=k7vzHIieQBIA:10 a=Qbun_eYptAEA:10 a=E9w9-soZzJTITTj17R0A:9 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:In-Reply-To:Date:References :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=bAcEVLUHC3S76VFMOJsLgvFWcCfs269D83DXDRUVAjo=; b=lxfY1o+raDc1/y1gpSAttwAwTb qwusb/04rlE5NrPhlQn6t8iwOIBJrUbQFg9DYILnyfmBtFUnS+DAdi23zvmxDjTzkWQ2kf2r5f4oo U+f2c4hckvMbUzuqXzW4emvNb; Received: from 71-211-170-195.hlrn.qwest.net ([71.211.170.195]:53378 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rcSPX-0044ZF-0H; Tue, 20 Feb 2024 08:51:59 -0700 From: Tom Tromey To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 8/8] [gdb/dap] Fix race between dap exit and gdb exit References: <20240219082341.21313-1-tdevries@suse.de> <20240219082341.21313-8-tdevries@suse.de> X-Attribution: Tom Date: Tue, 20 Feb 2024 08:51:57 -0700 In-Reply-To: <20240219082341.21313-8-tdevries@suse.de> (Tom de Vries's message of "Mon, 19 Feb 2024 09:23:41 +0100") Message-ID: <87wmqz16ci.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) 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: 71.211.170.195 X-Source-L: No X-Exim-ID: 1rcSPX-0044ZF-0H X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-170-195.hlrn.qwest.net (murgatroyd) [71.211.170.195]:53378 X-Source-Auth: tom+tromey.com X-Email-Count: 18 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfKE2aWM9x7P1RhOy8bss2j8Ajhl8w4xI5idRy1t7guIDo2FXSAYmSRS93xoBItU5GZ61ClosaUoxPCpcHJibwyypA4Ozdb0PiFraEDeIOaKhXMkuvLJE B8xRZzrD9GSADF5C5QtKe6kdfojyfe3QbmpezF6gYtNxrMn5vqkNPqa1SgLNuT/BXHiu1fdISccZoccM2LHLCynXMesEJkFfC2M= X-Spam-Status: No, score=-3016.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Tom" == Tom de Vries writes: Tom> +@in_gdb_thread Tom> +def _on_gdb_exiting(event): Tom> + dap_thread_join() I think it's better not to export dap_thread_join and then import it here, but instead just add to the event listener exactly where it's needed. Tom> + global _dap_thread_for_gdb_thread Tom> + _dap_thread_for_gdb_thread = start_thread("DAP", really_start_dap) You don't even need a new global if you add the listener here. Tom> +def dap_thread_join(): Tom> + global _dap_thread_for_gdb_thread Tom> + if _dap_thread_for_gdb_thread != None: None of this will be necessary with the above, but FYI in Python it's idiomatic to do this comparison with "if blah is not None" Tom