aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/symfile.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index d2fd08c..649b4bf 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -2849,6 +2849,10 @@ allocate_compunit_symtab (struct objfile *objfile, const char *name)
void
add_compunit_symtab_to_objfile (struct compunit_symtab *cu)
{
+#if CXX_STD_THREAD
+ static std::mutex add_compunit_symtab_to_objfile_lock;
+ std::lock_guard<std::mutex> guard (add_compunit_symtab_to_objfile_lock);
+#endif
cu->next = cu->objfile ()->compunit_symtabs;
cu->objfile ()->compunit_symtabs = cu;
}