diff options
author | Tom Tromey <tom@tromey.com> | 2024-01-09 13:21:12 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2024-01-09 13:22:55 -0700 |
commit | 8baaed84cbc1abf6797016f36c1d9842631c777e (patch) | |
tree | ddec1a33140ad77ec18cbfca1469d7c6eae610ed /gdb/dwarf2 | |
parent | d006ec41c448d9f4a84df50391e87cbf0aa8c152 (diff) | |
download | gdb-8baaed84cbc1abf6797016f36c1d9842631c777e.zip gdb-8baaed84cbc1abf6797016f36c1d9842631c777e.tar.gz gdb-8baaed84cbc1abf6797016f36c1d9842631c777e.tar.bz2 |
Fix thread-less build
A user pointed out that the recent background DWARF reader series
broke the build when --disable-threading is in use. This patch fixes
the problem. I am checking it in.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31223
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r-- | gdb/dwarf2/cooked-index.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h index b14930d..a26163f 100644 --- a/gdb/dwarf2/cooked-index.h +++ b/gdb/dwarf2/cooked-index.h @@ -517,18 +517,18 @@ private: #if CXX_STD_THREAD /* Current state of this object. */ cooked_state m_state = cooked_state::INITIAL; + /* Mutex and condition variable used to synchronize. */ + std::mutex m_mutex; + std::condition_variable m_cond; +#endif /* CXX_STD_THREAD */ /* This flag indicates whether any complaints or exceptions that arose during scanning have been reported by 'wait'. This may only be modified on the main thread. */ bool m_reported = false; - /* Mutex and condition variable used to synchronize. */ - std::mutex m_mutex; - std::condition_variable m_cond; /* If set, an exception occurred during start_reading; in this case the scanning is stopped and this exception will later be reported by the 'wait' method. */ std::optional<gdb_exception> m_failed; -#endif /* CXX_STD_THREAD */ }; /* The main index of DIEs. |