gold/
* 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.
This commit is contained in:
parent
9772d07483
commit
39d9ead7fb
3 changed files with 13 additions and 3 deletions
|
@ -1,5 +1,10 @@
|
||||||
2013-10-11 Roland McGrath <mcgrathr@google.com>
|
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
|
* archive.h: Use struct rather than class for forward declaration
|
||||||
of Read_symbols_data.
|
of Read_symbols_data.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// gold-threads.cc -- thread support for gold
|
// 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>.
|
// Written by Ian Lance Taylor <iant@google.com>.
|
||||||
|
|
||||||
// This file is part of gold.
|
// This file is part of gold.
|
||||||
|
@ -335,7 +335,10 @@ c_run_once(void)
|
||||||
// Class Once.
|
// Class Once.
|
||||||
|
|
||||||
Once::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
|
#ifndef ENABLE_THREADS
|
||||||
this->once_ = NULL;
|
this->once_ = NULL;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// gold-threads.h -- thread support for gold -*- C++ -*-
|
// 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>.
|
// Written by Ian Lance Taylor <iant@google.com>.
|
||||||
|
|
||||||
// This file is part of gold.
|
// This file is part of gold.
|
||||||
|
@ -223,8 +223,10 @@ class Once
|
||||||
private:
|
private:
|
||||||
// True if we have already run the function.
|
// True if we have already run the function.
|
||||||
bool was_run_;
|
bool was_run_;
|
||||||
|
#if defined(ENABLE_THREADS) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
|
||||||
// Internal compare-and-swap lock on was_run_;
|
// Internal compare-and-swap lock on was_run_;
|
||||||
uint32_t was_run_lock_;
|
uint32_t was_run_lock_;
|
||||||
|
#endif
|
||||||
// The lock to run the function only once.
|
// The lock to run the function only once.
|
||||||
Once_initialize* once_;
|
Once_initialize* once_;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue