From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 136113858D33 for ; Fri, 28 Jul 2023 11:00:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 136113858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 022D621910 for ; Fri, 28 Jul 2023 11:00:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1690542002; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=pEjGWKUELoVOj3sqtqrtMdSlgnLqLU+GxoDzESM/zdk=; b=OZeYxQjA4zvfMjsRMiqW2pUnTD3fszRgFi2LOX//+XjKaArL8HHZxvIpqxxKX3LU+CE5BY dnMp4KYJZjiLBn978y4b4ny3K1OL+K7IQUL5IBeEKOiyzNrA0NwERVkkpCZKWA6kOzCoYw Egl3r4t4BrrmdO8XN8gPCBVO1R2sR0k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1690542002; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=pEjGWKUELoVOj3sqtqrtMdSlgnLqLU+GxoDzESM/zdk=; b=aQ4c0n9bkw6scrBT25VWSsZ4HAl5iO8TaV5lcDC70Sy1Pr029XctdBfmCHL+FSdkfBvMA0 7SdqbeFuVU+Bh5Cw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DC0CF133F7 for ; Fri, 28 Jul 2023 11:00:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Zx2AMrGfw2QoOQAAMHmgww (envelope-from ) for ; Fri, 28 Jul 2023 11:00:01 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH 1/2] [gdb] Rename variable main_thread to main_thread_id Date: Fri, 28 Jul 2023 12:59:44 +0200 Message-Id: <20230728105945.13909-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: I noticed that the variable main_thread: ... /* The main thread. */ static std::thread::id main_thread; ... has a confusing name and corresponding comment, because it doesn't contain the main thread, but rather the main thread's std::thread::id. Fix this by renaming to main_thread_id. Tested on x86_64-linux. --- gdb/run-on-main-thread.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/run-on-main-thread.c b/gdb/run-on-main-thread.c index c7d9de0afc8..91d25dae28f 100644 --- a/gdb/run-on-main-thread.c +++ b/gdb/run-on-main-thread.c @@ -39,9 +39,9 @@ static std::vector> runnables; static std::mutex runnable_mutex; -/* The main thread. */ +/* The main thread's thread id. */ -static std::thread::id main_thread; +static std::thread::id main_thread_id; #endif @@ -100,7 +100,7 @@ bool is_main_thread () { #if CXX_STD_THREAD - return std::this_thread::get_id () == main_thread; + return std::this_thread::get_id () == main_thread_id; #else return true; #endif @@ -111,7 +111,7 @@ void _initialize_run_on_main_thread () { #if CXX_STD_THREAD - main_thread = std::this_thread::get_id (); + main_thread_id = std::this_thread::get_id (); #endif runnable_event = make_serial_event (); add_file_handler (serial_event_fd (runnable_event), run_events, nullptr, base-commit: 29c108c9610640439daa5244a573348b7c47d994 -- 2.35.3