]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix thread-less build
authorTom Tromey <tom@tromey.com>
Tue, 9 Jan 2024 20:21:12 +0000 (13:21 -0700)
committerTom Tromey <tom@tromey.com>
Tue, 9 Jan 2024 20:22:55 +0000 (13:22 -0700)
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

index b14930d558f7d9cd6a75657c31ab1b470dfe6aba..a26163f1c419671a922e79f6d38f7e9d4e36d410 100644 (file)
@@ -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.