gold/
authorRoland McGrath <roland@gnu.org>
Fri, 11 Oct 2013 21:02:43 +0000 (21:02 +0000)
committerRoland McGrath <roland@gnu.org>
Fri, 11 Oct 2013 21:02:43 +0000 (21:02 +0000)
* gold-threads.h (Once): Conditionalize member was_run_lock_ on
[ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
its only use.
* gold-threads.cc (Once::Once): Likewise conditionalize initializer.

gold/ChangeLog
gold/gold-threads.cc
gold/gold-threads.h

index 9949b9847c0d0a8fa9a3d5bcd2f3d87970294f73..ecb2bd56e612a3d206aa69204939add0b456bb60 100644 (file)
@@ -1,5 +1,10 @@
 2013-10-11  Roland McGrath  <mcgrathr@google.com>
 
+       * gold-threads.h (Once): Conditionalize member was_run_lock_ on
+       [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
+       its only use.
+       * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
+
        * archive.h: Use struct rather than class for forward declaration
        of Read_symbols_data.
 
index 38a1e1600da72968012809c4adb80963ec6c241a..2cb293e372ba3c5913897fce1399eceaf24d60fd 100644 (file)
@@ -1,6 +1,6 @@
 // gold-threads.cc -- thread support for gold
 
-// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009, 2010, 2013 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -335,7 +335,10 @@ c_run_once(void)
 // Class Once.
 
 Once::Once()
-  : was_run_(false), was_run_lock_(0)
+  : was_run_(false)
+#if defined(ENABLE_THREADS) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
+    , was_run_lock_(0)
+#endif
 {
 #ifndef ENABLE_THREADS
   this->once_ = NULL;
index 622bf329d166a9393e128f38684612d93fb57e88..5751f62b825c68c889c3f3d2ae4740a60106d693 100644 (file)
@@ -1,6 +1,6 @@
 // gold-threads.h -- thread support for gold  -*- C++ -*-
 
-// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009, 2010, 2013 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -223,8 +223,10 @@ class Once
  private:
   // True if we have already run the function.
   bool was_run_;
+#if defined(ENABLE_THREADS) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
   // Internal compare-and-swap lock on was_run_;
   uint32_t was_run_lock_;
+#endif
   // The lock to run the function only once.
   Once_initialize* once_;
 };
This page took 0.044901 seconds and 4 git commands to generate.