aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-07-28 16:01:51 +0200
committerTom de Vries <tdevries@suse.de>2023-07-28 16:01:51 +0200
commit07d8d4bd2ad213281be502d6e56c19e0269b8967 (patch)
tree2ff10322669f11282a09c544f9a5dde0f21b7773 /gdb
parent0c8a0b88d18d9c8d6cd52bd1a56d6ab88570f287 (diff)
downloadgdb-07d8d4bd2ad213281be502d6e56c19e0269b8967.zip
gdb-07d8d4bd2ad213281be502d6e56c19e0269b8967.tar.gz
gdb-07d8d4bd2ad213281be502d6e56c19e0269b8967.tar.bz2
[gdb] Rename variable main_thread to main_thread_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. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/run-on-main-thread.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/run-on-main-thread.c b/gdb/run-on-main-thread.c
index c7d9de0..91d25da 100644
--- a/gdb/run-on-main-thread.c
+++ b/gdb/run-on-main-thread.c
@@ -39,9 +39,9 @@ static std::vector<std::function<void ()>> 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,