#include "base/synchronization/lock.h"
#include <stdlib.h>
#include <cstdint>
#include "base/compiler_specific.h"
#include "base/dcheck_is_on.h"
#include "base/memory/raw_ptr.h"
#include "base/synchronization/lock_subtle.h"
#include "base/test/gtest_util.h"
#include "base/threading/platform_thread.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
UnorderedElementsAre;
UnorderedElementsAreArray;
namespace base {
class BasicLockTestThread : public PlatformThread::Delegate { … };
TEST(LockTest, Basic) { … }
class TryLockTestThread : public PlatformThread::Delegate { … };
TEST(LockTest, TryLock) { … }
class MutexLockTestThread : public PlatformThread::Delegate { … };
TEST(LockTest, MutexTwoThreads) { … }
TEST(LockTest, MutexFourThreads) { … }
TEST(LockTest, AutoLockMaybe) { … }
TEST(LockTest, AutoLockMaybeNull) { … }
TEST(LockTest, ReleasableAutoLockExplicitRelease) { … }
TEST(LockTest, ReleasableAutoLockImplicitRelease) { … }
class TryLockTest : public testing::Test { … };
TEST_F(TryLockTest, CorrectlyCheckIsAcquired) { … }
#if DCHECK_IS_ON()
TEST(LockTest, GetTrackedLocksHeldByCurrentThread) { … }
TEST(LockTest, GetTrackedLocksHeldByCurrentThread_AutoLock) { … }
TEST(LockTest, GetTrackedLocksHeldByCurrentThread_MovableAutoLock) { … }
TEST(LockTest, GetTrackedLocksHeldByCurrentThread_AutoTryLock) { … }
TEST(LockTest, GetTrackedLocksHeldByCurrentThread_AutoLockMaybe) { … }
TEST(LockTest, GetTrackedLocksHeldByCurrentThreadOverCapacity)
NO_THREAD_SAFETY_ANALYSIS { … }
TEST(LockTest, TrackingDisabled) { … }
#endif
}