public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] Fix thread-less build
@ 2024-01-09 20:23 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2024-01-09 20:23 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

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
---
 gdb/dwarf2/cooked-index.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h
index b14930d558f..a26163f1c41 100644
--- a/gdb/dwarf2/cooked-index.h
+++ b/gdb/dwarf2/cooked-index.h
@@ -517,18 +517,18 @@ class cooked_index_worker
 #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.
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-09 20:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-09 20:23 [pushed] Fix thread-less build Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).