Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions deps/googletest/include/gtest/internal/gtest-port.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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_;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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_;
Expand Down Expand Up @@ -1864,8 +1864,8 @@ class GTEST_API_ ThreadLocal {
class Mutex {
public:
Mutex() {}
void Lock() {}
void Unlock() {}
void lock() {}
void unlock() {}
void AssertHeld() const {}
};

Expand Down Expand Up @@ -2322,6 +2322,13 @@ const char* StringFromGTestEnv(const char* flag, const char* default_val);
} // namespace internal
} // namespace testing

#if GTEST_INTERNAL_HAVE_CPP_ATTRIBUTE(clang::annotate)
#define GTEST_INTERNAL_DEPRECATE_AND_INLINE(msg) \
[[deprecated(msg), clang::annotate("inline-me")]]
#else
#define GTEST_INTERNAL_DEPRECATE_AND_INLINE(msg) [[deprecated(msg)]]
#endif

#if defined(__cpp_lib_span) || (GTEST_INTERNAL_HAS_INCLUDE(<span>) && \
GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L)
#define GTEST_INTERNAL_HAS_STD_SPAN 1
Expand Down
4 changes: 2 additions & 2 deletions deps/googletest/src/gtest-port.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading