diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h index c4c42b7c..445a3ed8 100644 --- a/googlemock/include/gmock/gmock-spec-builders.h +++ b/googlemock/include/gmock/gmock-spec-builders.h @@ -1530,7 +1530,7 @@ class FunctionMocker final : public UntypedFunctionMockerBase { UntypedOnCallSpecs specs_to_delete; untyped_on_call_specs_.swap(specs_to_delete); - g_gmock_mutex.Unlock(); + g_gmock_mutex.unlock(); for (UntypedOnCallSpecs::const_iterator it = specs_to_delete.begin(); it != specs_to_delete.end(); ++it) { delete static_cast*>(*it); @@ -1538,7 +1538,7 @@ class FunctionMocker final : public UntypedFunctionMockerBase { // Lock the mutex again, since the caller expects it to be locked when we // return. - g_gmock_mutex.Lock(); + g_gmock_mutex.lock(); } // Returns the result of invoking this mock function with the given diff --git a/googlemock/src/gmock-spec-builders.cc b/googlemock/src/gmock-spec-builders.cc index b681fee7..603ad7aa 100644 --- a/googlemock/src/gmock-spec-builders.cc +++ b/googlemock/src/gmock-spec-builders.cc @@ -436,9 +436,9 @@ bool UntypedFunctionMockerBase::VerifyAndClearExpectationsLocked() UntypedExpectations expectations_to_delete; untyped_expectations_.swap(expectations_to_delete); - g_gmock_mutex.Unlock(); + g_gmock_mutex.unlock(); expectations_to_delete.clear(); - g_gmock_mutex.Lock(); + g_gmock_mutex.lock(); return expectations_met; } diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h index 06a5a8e6..9bd41cd6 100644 --- a/googletest/include/gtest/internal/gtest-port.h +++ b/googletest/include/gtest/internal/gtest-port.h @@ -1385,9 +1385,9 @@ class GTEST_API_ Mutex { Mutex(); ~Mutex(); - void Lock(); + void lock(); - void Unlock(); + void unlock(); // Does nothing if the current thread holds the mutex. Otherwise, crashes // with high probability. @@ -1424,9 +1424,9 @@ class GTEST_API_ Mutex { // "MutexLock l(&mu)". Hence the typedef trick below. class GTestMutexLock { public: - explicit GTestMutexLock(Mutex* mutex) : mutex_(mutex) { mutex_->Lock(); } + explicit GTestMutexLock(Mutex* mutex) : mutex_(mutex) { mutex_->lock(); } - ~GTestMutexLock() { mutex_->Unlock(); } + ~GTestMutexLock() { mutex_->unlock(); } private: Mutex* const mutex_; @@ -1641,14 +1641,14 @@ class ThreadLocal : public ThreadLocalBase { class MutexBase { public: // Acquires this mutex. - void Lock() { + void lock() { GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_)); owner_ = pthread_self(); has_owner_ = true; } // Releases this mutex. - void Unlock() { + void unlock() { // Since the lock is being released the owner_ field should no longer be // considered valid. We don't protect writing to has_owner_ here, as it's // the caller's responsibility to ensure that the current thread holds the @@ -1716,9 +1716,9 @@ class Mutex : public MutexBase { // "MutexLock l(&mu)". Hence the typedef trick below. class GTestMutexLock { public: - explicit GTestMutexLock(MutexBase* mutex) : mutex_(mutex) { mutex_->Lock(); } + explicit GTestMutexLock(MutexBase* mutex) : mutex_(mutex) { mutex_->lock(); } - ~GTestMutexLock() { mutex_->Unlock(); } + ~GTestMutexLock() { mutex_->unlock(); } private: MutexBase* const mutex_; @@ -1864,8 +1864,8 @@ class GTEST_API_ ThreadLocal { class Mutex { public: Mutex() {} - void Lock() {} - void Unlock() {} + void lock() {} + void unlock() {} void AssertHeld() const {} }; diff --git a/googletest/src/gtest-port.cc b/googletest/src/gtest-port.cc index 1038ad7b..490dbb57 100644 --- a/googletest/src/gtest-port.cc +++ b/googletest/src/gtest-port.cc @@ -320,13 +320,13 @@ Mutex::~Mutex() { } } -void Mutex::Lock() { +void Mutex::lock() { ThreadSafeLazyInit(); ::EnterCriticalSection(critical_section_); owner_thread_id_ = ::GetCurrentThreadId(); } -void Mutex::Unlock() { +void Mutex::unlock() { ThreadSafeLazyInit(); // We don't protect writing to owner_thread_id_ here, as it's the // caller's responsibility to ensure that the current thread holds the diff --git a/googletest/test/googletest-port-test.cc b/googletest/test/googletest-port-test.cc index 9f05a019..975b2fc3 100644 --- a/googletest/test/googletest-port-test.cc +++ b/googletest/test/googletest-port-test.cc @@ -288,8 +288,8 @@ TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownFileAndLine) { defined(GTEST_OS_OPENBSD) || defined(GTEST_OS_GNU_HURD) void* ThreadFunc(void* data) { internal::Mutex* mutex = static_cast(data); - mutex->Lock(); - mutex->Unlock(); + mutex->lock(); + mutex->unlock(); return nullptr; }