gdb: fix vfork with multiple threads
[deliverable/binutils-gdb.git] / gold / fileread.cc
index f5ca719360d68dee9a851556d76831fb6c637fa2..12ae1b4a6e86f328825fa5ab5d5f5980d857432b 100644 (file)
@@ -1,6 +1,6 @@
 // fileread.cc -- read files for gold
 
-// Copyright (C) 2006-2020 Free Software Foundation, Inc.
+// Copyright (C) 2006-2021 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -212,6 +212,7 @@ File_read::open(const Task* task, const std::string& name)
       gold_debug(DEBUG_FILES, "Attempt to open %s succeeded",
                 this->name_.c_str());
       this->token_.add_writer(task);
+      file_counts_initialize_lock.initialize();
       Hold_optional_lock hl(file_counts_lock);
       record_file_read(this->name_);
     }
This page took 0.023276 seconds and 4 git commands to generate.