Skip to content

Commit 07d8d4b

Browse files
committed
[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 <[email protected]>
1 parent 0c8a0b8 commit 07d8d4b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gdb/run-on-main-thread.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ static std::vector<std::function<void ()>> runnables;
3939

4040
static std::mutex runnable_mutex;
4141

42-
/* The main thread. */
42+
/* The main thread's thread id. */
4343

44-
static std::thread::id main_thread;
44+
static std::thread::id main_thread_id;
4545

4646
#endif
4747

@@ -100,7 +100,7 @@ bool
100100
is_main_thread ()
101101
{
102102
#if CXX_STD_THREAD
103-
return std::this_thread::get_id () == main_thread;
103+
return std::this_thread::get_id () == main_thread_id;
104104
#else
105105
return true;
106106
#endif
@@ -111,7 +111,7 @@ void
111111
_initialize_run_on_main_thread ()
112112
{
113113
#if CXX_STD_THREAD
114-
main_thread = std::this_thread::get_id ();
114+
main_thread_id = std::this_thread::get_id ();
115115
#endif
116116
runnable_event = make_serial_event ();
117117
add_file_handler (serial_event_fd (runnable_event), run_events, nullptr,

0 commit comments

Comments
 (0)