// gold-threads.cc -- thread support for gold
-// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2006-2019 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
pthread_mutexattr_t attr;
int err = pthread_mutexattr_init(&attr);
if (err != 0)
- gold_fatal(_("pthead_mutextattr_init failed: %s"), strerror(err));
+ gold_fatal(_("pthead_mutexattr_init failed: %s"), strerror(err));
#ifdef PTHREAD_MUTEX_ADAPTIVE_NP
- err = pthread_mutextattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP);
+ err = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP);
if (err != 0)
- gold_fatal(_("pthread_mutextattr_settype failed: %s"), strerror(err));
+ gold_fatal(_("pthread_mutexattr_settype failed: %s"), strerror(err));
#endif
- err = pthread_mutex_init (&this->mutex_, &attr);
+ err = pthread_mutex_init(&this->mutex_, &attr);
if (err != 0)
gold_fatal(_("pthread_mutex_init failed: %s"), strerror(err));
// 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;
err = pthread_mutex_unlock(&once_pointer_control);
if (err != 0)
- gold_fatal(_("pthread_mutex_unlock falied: %s"), strerror(err));
+ gold_fatal(_("pthread_mutex_unlock failed: %s"), strerror(err));
#endif // defined(ENABLE_THREADS)
}