[NFC][libcxxabi] Rename GlobalLock to GlobalMutex
authorDaniel McIntosh <Daniel.McIntosh@ibm.com>
Wed, 11 Aug 2021 14:47:48 +0000 (10:47 -0400)
committerDaniel McIntosh <Daniel.McIntosh@ibm.com>
Wed, 12 Jan 2022 22:29:17 +0000 (17:29 -0500)
This will make the naming more consistent with what it's called in the
rest of the file.

This is the 1st of 5 changes to overhaul cxa_guard.
See D108343 for what the final result will be.

Reviewed By: ldionne, #libc_abi

Differential Revision: https://reviews.llvm.org/D109539

libcxxabi/src/cxa_guard_impl.h
libcxxabi/test/guard_test_basic.pass.cpp
libcxxabi/test/guard_threaded_test.pass.cpp

index df3f4a4..32dbb18 100644 (file)
@@ -510,7 +510,7 @@ struct GlobalStatic {
 template <class T>
 _LIBCPP_SAFE_STATIC T GlobalStatic<T>::instance = {};
 
-enum class Implementation { NoThreads, GlobalLock, Futex };
+enum class Implementation { NoThreads, GlobalMutex, Futex };
 
 template <Implementation Impl>
 struct SelectImplementation;
@@ -521,7 +521,7 @@ struct SelectImplementation<Implementation::NoThreads> {
 };
 
 template <>
-struct SelectImplementation<Implementation::GlobalLock> {
+struct SelectImplementation<Implementation::GlobalMutex> {
   using type = InitByteGlobalMutex<LibcppMutex, LibcppCondVar, GlobalStatic<LibcppMutex>::instance,
                                    GlobalStatic<LibcppCondVar>::instance, PlatformThreadID>;
 };
@@ -539,7 +539,7 @@ constexpr Implementation CurrentImplementation =
 #elif defined(_LIBCXXABI_USE_FUTEX)
     Implementation::Futex;
 #else
-    Implementation::GlobalLock;
+    Implementation::GlobalMutex;
 #endif
 
 static_assert(CurrentImplementation != Implementation::Futex || PlatformSupportsFutex(),
index 4cd11fd..b97aeb2 100644 (file)
@@ -121,7 +121,7 @@ int main(int, char**) {
     static_assert(
         std::is_same<SelectedImplementation, InitByteNoThreads>::value, "");
 #else
-    static_assert(CurrentImplementation == Implementation::GlobalLock, "");
+    static_assert(CurrentImplementation == Implementation::GlobalMutex, "");
     static_assert(
         std::is_same<
             SelectedImplementation,
index 798d11b..ce589fe 100644 (file)
@@ -326,7 +326,7 @@ void test_impl() {
   }
 
 void test_all_impls() {
-  using MutexImpl = SelectImplementation<Implementation::GlobalLock>::type;
+  using MutexImpl = SelectImplementation<Implementation::GlobalMutex>::type;
 
   // Attempt to test the Futex based implementation if it's supported on the
   // target platform.