Lines Matching full:mutex
18 #include "pw_sync/mutex.h"
26 void pw_sync_Mutex_CallLock(pw_sync_Mutex* mutex);
27 bool pw_sync_Mutex_CallTryLock(pw_sync_Mutex* mutex);
28 void pw_sync_Mutex_CallUnlock(pw_sync_Mutex* mutex);
34 TEST(Mutex, LockUnlock) { in TEST() argument
35 pw::sync::Mutex mutex; in TEST() local
36 mutex.lock(); in TEST()
38 // EXPECT_FALSE(mutex.try_lock()); in TEST()
39 mutex.unlock(); in TEST()
42 Mutex static_mutex;
43 TEST(Mutex, LockUnlockStatic) { in TEST() argument
50 TEST(Mutex, TryLockUnlock) { in TEST() argument
51 pw::sync::Mutex mutex; in TEST() local
52 const bool locked = mutex.try_lock(); in TEST()
56 // EXPECT_FALSE(mutex.try_lock()); in TEST()
57 mutex.unlock(); in TEST()
61 TEST(Mutex, LockUnlockInC) { in TEST() argument
62 pw::sync::Mutex mutex; in TEST() local
63 pw_sync_Mutex_CallLock(&mutex); in TEST()
64 pw_sync_Mutex_CallUnlock(&mutex); in TEST()
67 TEST(Mutex, TryLockUnlockInC) { in TEST() argument
68 pw::sync::Mutex mutex; in TEST() local
69 ASSERT_TRUE(pw_sync_Mutex_CallTryLock(&mutex)); in TEST()
71 // EXPECT_FALSE(pw_sync_Mutex_CallTryLock(&mutex)); in TEST()
72 pw_sync_Mutex_CallUnlock(&mutex); in TEST()