X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gold%2Fgold-threads.cc;h=f972a8c97d35a2cb17001658e87eb5ca74ef5407;hb=1e92785005ce880a5fac9d022f05cdcff91c3091;hp=ef5b6922e313a575bc7f7ebd089b7be8133da814;hpb=0f32ea4ce3309801590068305e7c8d7aeb495f2f;p=deliverable%2Fbinutils-gdb.git diff --git a/gold/gold-threads.cc b/gold/gold-threads.cc index ef5b6922e3..f972a8c97d 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-2020 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)); + 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)); @@ -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) }