X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gold%2Fgold-threads.cc;h=36f3625e5152b2faa2c9aec80d3d71c1194ff3e9;hb=aa989b27d0bad451455416953c0e5026e229863a;hp=f5347bfcb4ae9a616f681ca38108a48a01a3ee93;hpb=114dfbe13efea1a1405dbcf5d9254e59d309382f;p=deliverable%2Fbinutils-gdb.git diff --git a/gold/gold-threads.cc b/gold/gold-threads.cc index f5347bfcb4..36f3625e51 100644 --- a/gold/gold-threads.cc +++ b/gold/gold-threads.cc @@ -1,6 +1,6 @@ // 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 . // This file is part of gold. @@ -100,14 +100,14 @@ Lock_impl_threads::Lock_impl_threads() pthread_mutexattr_t attr; int err = pthread_mutexattr_init(&attr); if (err != 0) - gold_fatal(_("pthead_mutextattr_init failed: %s"), strerror(err)); -#ifdef PTHREAD_MUTEXT_ADAPTIVE_NP - err = pthread_mutextattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP); + gold_fatal(_("pthead_mutexattr_init failed: %s"), strerror(err)); +#ifdef 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)); @@ -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; @@ -404,7 +407,7 @@ Once::run_once(void* arg) 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) }