diff --git a/libcxxabi/src/cxa_guard_impl.h b/libcxxabi/src/cxa_guard_impl.h --- a/libcxxabi/src/cxa_guard_impl.h +++ b/libcxxabi/src/cxa_guard_impl.h @@ -220,10 +220,10 @@ // Global Mutex Implementation //===----------------------------------------------------------------------===// +#ifndef _LIBCXXABI_HAS_NO_THREADS struct LibcppMutex; struct LibcppCondVar; -#ifndef _LIBCXXABI_HAS_NO_THREADS struct LibcppMutex { LibcppMutex() = default; LibcppMutex(LibcppMutex const&) = delete; @@ -514,6 +514,7 @@ using type = InitByteNoThreads; }; +#ifndef _LIBCXXABI_HAS_NO_THREADS template <> struct SelectImplementation { using type = InitByteGlobalMutex< @@ -526,6 +527,7 @@ using type = InitByteFutex; }; +#endif // TODO(EricWF): We should prefer the futex implementation when available. But // it should be done in a separate step from adding the implementation. @@ -535,7 +537,7 @@ #elif defined(_LIBCXXABI_USE_FUTEX) Implementation::Futex; #else - Implementation::GlobalLock; + Implementation::GlobalLock; #endif static_assert(CurrentImplementation != Implementation::Futex