* i386-linux-tdep.c (I386_LINUX_RECORD_SIZE_*,
[deliverable/binutils-gdb.git] / gold / target-select.cc
index 55d63b2dace72c76b9fbc704893621455b2c557f..dcd3017f07c31694d77b9a77589b7120ab858ce8 100644 (file)
@@ -60,10 +60,15 @@ Target_selector::Target_selector(int machine, int size, bool is_big_endian,
 Target*
 Target_selector::instantiate_target()
 {
-  this->initialize_lock_.initialize();
-  Hold_optional_lock hl(this->lock_);
+  // We assume that the pointer will either be written entirely or not
+  // at all.
   if (this->instantiated_target_ == NULL)
-    this->instantiated_target_ = this->do_instantiate_target();
+    {
+      this->initialize_lock_.initialize();
+      Hold_optional_lock hl(this->lock_);
+      if (this->instantiated_target_ == NULL)
+       this->instantiated_target_ = this->do_instantiate_target();
+    }
   return this->instantiated_target_;
 }
 
This page took 0.033812 seconds and 4 git commands to generate.