| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1385,9 +1385,9 @@ class GTEST_API_ Mutex { | |||
| 1385 | 1385 | Mutex(); | |
| 1386 | 1386 | ~Mutex(); | |
| 1387 | 1387 | ||
| 1388 | - void Lock(); | ||
| 1388 | + void lock(); | ||
| 1389 | 1389 | ||
| 1390 | - void Unlock(); | ||
| 1390 | + void unlock(); | ||
| 1391 | 1391 | ||
| 1392 | 1392 | // Does nothing if the current thread holds the mutex. Otherwise, crashes | |
| 1393 | 1393 | // with high probability. | |
@@ -1424,9 +1424,9 @@ class GTEST_API_ Mutex { | |||
| 1424 | 1424 | // "MutexLock l(&mu)". Hence the typedef trick below. | |
| 1425 | 1425 | class GTestMutexLock { | |
| 1426 | 1426 | public: | |
| 1427 | - explicit GTestMutexLock(Mutex* mutex) : mutex_(mutex) { mutex_->Lock(); } | ||
| 1427 | + explicit GTestMutexLock(Mutex* mutex) : mutex_(mutex) { mutex_->lock(); } | ||
| 1428 | 1428 | ||
| 1429 | - ~GTestMutexLock() { mutex_->Unlock(); } | ||
| 1429 | + ~GTestMutexLock() { mutex_->unlock(); } | ||
| 1430 | 1430 | ||
| 1431 | 1431 | private: | |
| 1432 | 1432 | Mutex* const mutex_; | |
@@ -1641,14 +1641,14 @@ class ThreadLocal : public ThreadLocalBase { | |||
| 1641 | 1641 | class MutexBase { | |
| 1642 | 1642 | public: | |
| 1643 | 1643 | // Acquires this mutex. | |
| 1644 | - void Lock() { | ||
| 1644 | + void lock() { | ||
| 1645 | 1645 | GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_)); | |
| 1646 | 1646 | owner_ = pthread_self(); | |
| 1647 | 1647 | has_owner_ = true; | |
| 1648 | 1648 | } | |
| 1649 | 1649 | ||
| 1650 | 1650 | // Releases this mutex. | |
| 1651 | - void Unlock() { | ||
| 1651 | + void unlock() { | ||
| 1652 | 1652 | // Since the lock is being released the owner_ field should no longer be | |
| 1653 | 1653 | // considered valid. We don't protect writing to has_owner_ here, as it's | |
| 1654 | 1654 | // the caller's responsibility to ensure that the current thread holds the | |
@@ -1716,9 +1716,9 @@ class Mutex : public MutexBase { | |||
| 1716 | 1716 | // "MutexLock l(&mu)". Hence the typedef trick below. | |
| 1717 | 1717 | class GTestMutexLock { | |
| 1718 | 1718 | public: | |
| 1719 | - explicit GTestMutexLock(MutexBase* mutex) : mutex_(mutex) { mutex_->Lock(); } | ||
| 1719 | + explicit GTestMutexLock(MutexBase* mutex) : mutex_(mutex) { mutex_->lock(); } | ||
| 1720 | 1720 | ||
| 1721 | - ~GTestMutexLock() { mutex_->Unlock(); } | ||
| 1721 | + ~GTestMutexLock() { mutex_->unlock(); } | ||
| 1722 | 1722 | ||
| 1723 | 1723 | private: | |
| 1724 | 1724 | MutexBase* const mutex_; | |
@@ -1864,8 +1864,8 @@ class GTEST_API_ ThreadLocal { | |||
| 1864 | 1864 | class Mutex { | |
| 1865 | 1865 | public: | |
| 1866 | 1866 | Mutex() {} | |
| 1867 | - void Lock() {} | ||
| 1868 | - void Unlock() {} | ||
| 1867 | + void lock() {} | ||
| 1868 | + void unlock() {} | ||
| 1869 | 1869 | void AssertHeld() const {} | |
| 1870 | 1870 | }; | |
| 1871 | 1871 | ||
@@ -2322,6 +2322,13 @@ const char* StringFromGTestEnv(const char* flag, const char* default_val); | |||
| 2322 | 2322 | } // namespace internal | |
| 2323 | 2323 | } // namespace testing | |
| 2324 | 2324 | ||
| 2325 | + #if GTEST_INTERNAL_HAVE_CPP_ATTRIBUTE(clang::annotate) | ||
| 2326 | + #define GTEST_INTERNAL_DEPRECATE_AND_INLINE(msg) \ | ||
| 2327 | + [[deprecated(msg), clang::annotate("inline-me")]] | ||
| 2328 | + #else | ||
| 2329 | + #define GTEST_INTERNAL_DEPRECATE_AND_INLINE(msg) [[deprecated(msg)]] | ||
| 2330 | + #endif | ||
| 2331 | + | ||
| 2325 | 2332 | #if defined(__cpp_lib_span) || (GTEST_INTERNAL_HAS_INCLUDE(<span>) && \ | |
| 2326 | 2333 | GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L) | |
| 2327 | 2334 | #define GTEST_INTERNAL_HAS_STD_SPAN 1 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -320,13 +320,13 @@ Mutex::~Mutex() { | |||
| 320 | 320 | } | |
| 321 | 321 | } | |
| 322 | 322 | ||
| 323 | - void Mutex::Lock() { | ||
| 323 | + void Mutex::lock() { | ||
| 324 | 324 | ThreadSafeLazyInit(); | |
| 325 | 325 | ::EnterCriticalSection(critical_section_); | |
| 326 | 326 | owner_thread_id_ = ::GetCurrentThreadId(); | |
| 327 | 327 | } | |
| 328 | 328 | ||
| 329 | - void Mutex::Unlock() { | ||
| 329 | + void Mutex::unlock() { | ||
| 330 | 330 | ThreadSafeLazyInit(); | |
| 331 | 331 | // We don't protect writing to owner_thread_id_ here, as it's the | |
| 332 | 332 | // caller's responsibility to ensure that the current thread holds the | |
| Back | FazBrowse Home | New Git URL |
0 commit comments