[libcxx-commits] [libcxxabi] e42eeb8 - [NFC][libcxxabi] Rename GlobalLock to GlobalMutex

Daniel McIntosh via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 12 14:29:21 PST 2022


Author: Daniel McIntosh
Date: 2022-01-12T17:29:17-05:00
New Revision: e42eeb88d7b2041d91f8e5ecaac313a4e3e13cbc

URL: https://github.com/llvm/llvm-project/commit/e42eeb88d7b2041d91f8e5ecaac313a4e3e13cbc
DIFF: https://github.com/llvm/llvm-project/commit/e42eeb88d7b2041d91f8e5ecaac313a4e3e13cbc.diff

LOG: [NFC][libcxxabi] Rename GlobalLock to GlobalMutex

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/libcxxabi/src/cxa_guard_impl.h b/libcxxabi/src/cxa_guard_impl.h
index df3f4a48bb48d..32dbb18bd396f 100644
--- a/libcxxabi/src/cxa_guard_impl.h
+++ b/libcxxabi/src/cxa_guard_impl.h
@@ -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(),

diff  --git a/libcxxabi/test/guard_test_basic.pass.cpp b/libcxxabi/test/guard_test_basic.pass.cpp
index 4cd11fdc11f23..b97aeb226d97a 100644
--- a/libcxxabi/test/guard_test_basic.pass.cpp
+++ b/libcxxabi/test/guard_test_basic.pass.cpp
@@ -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,

diff  --git a/libcxxabi/test/guard_threaded_test.pass.cpp b/libcxxabi/test/guard_threaded_test.pass.cpp
index 798d11b15d1ab..ce589fe680b44 100644
--- a/libcxxabi/test/guard_threaded_test.pass.cpp
+++ b/libcxxabi/test/guard_threaded_test.pass.cpp
@@ -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.


        


More information about the libcxx-commits mailing list