Lines Matching refs:m
84 mtx_t m; in TEST()
85 ASSERT_EQ(thrd_success, mtx_init(&m, mtx_plain)); in TEST()
92 auto waiter = [&c, &i, &m] { in TEST()
93 ASSERT_EQ(thrd_success, mtx_lock(&m)); in TEST()
94 while (i != 1) ASSERT_EQ(thrd_success, cnd_wait(&c, &m)); in TEST()
95 ASSERT_EQ(thrd_success, mtx_unlock(&m)); in TEST()
101 ASSERT_EQ(thrd_success, mtx_lock(&m)); in TEST()
103 ASSERT_EQ(thrd_success, mtx_unlock(&m)); in TEST()
111 mtx_destroy(&m); in TEST()
130 mtx_t m; in TEST()
131 ASSERT_EQ(thrd_success, mtx_init(&m, mtx_plain)); in TEST()
136 auto waiter = [&c, &m, &count] { in TEST()
137 ASSERT_EQ(thrd_success, mtx_lock(&m)); in TEST()
138 ASSERT_EQ(thrd_success, cnd_wait(&c, &m)); in TEST()
139 ASSERT_EQ(thrd_success, mtx_unlock(&m)); in TEST()
171 mtx_destroy(&m); in TEST()
180 mtx_t m; in TEST()
181 ASSERT_EQ(thrd_success, mtx_init(&m, mtx_timed)); in TEST()
182 ASSERT_EQ(thrd_success, mtx_lock(&m)); in TEST()
188 ASSERT_EQ(thrd_timedout, cnd_timedwait(&c, &m, &ts)); in TEST()
196 mtx_t m; in TEST()
197 ASSERT_EQ(thrd_success, mtx_init(&m, mtx_timed)); in TEST()
203 std::thread t([&c, &m, &done] { in TEST()
204 ASSERT_EQ(thrd_success, mtx_lock(&m)); in TEST()
211 ASSERT_EQ(thrd_success, cnd_timedwait(&c, &m, &ts)); in TEST()
213 ASSERT_EQ(thrd_success, mtx_unlock(&m)); in TEST()
226 mtx_t m; in TEST()
227 ASSERT_EQ(thrd_success, mtx_init(&m, mtx_plain)); in TEST()
228 ASSERT_EQ(thrd_success, mtx_init(&m, mtx_timed)); in TEST()
229 ASSERT_EQ(thrd_success, mtx_init(&m, mtx_plain | mtx_recursive)); in TEST()
230 ASSERT_EQ(thrd_success, mtx_init(&m, mtx_timed | mtx_recursive)); in TEST()
231 ASSERT_EQ(thrd_error, mtx_init(&m, 123)); in TEST()
232 ASSERT_EQ(thrd_error, mtx_init(&m, mtx_recursive)); in TEST()
240 mtx_t m; in TEST()
241 ASSERT_EQ(thrd_success, mtx_init(&m, mtx_plain)); in TEST()
242 mtx_destroy(&m); in TEST()
250 mtx_t m; in TEST()
251 ASSERT_EQ(thrd_success, mtx_init(&m, mtx_plain)); in TEST()
253 ASSERT_EQ(thrd_success, mtx_lock(&m)); in TEST()
254 ASSERT_EQ(thrd_busy, mtx_trylock(&m)); in TEST()
255 ASSERT_EQ(thrd_success, mtx_unlock(&m)); in TEST()
257 mtx_destroy(&m); in TEST()
265 mtx_t m; in TEST()
266 ASSERT_EQ(thrd_success, mtx_init(&m, mtx_plain | mtx_recursive)); in TEST()
268 ASSERT_EQ(thrd_success, mtx_lock(&m)); in TEST()
269 ASSERT_EQ(thrd_success, mtx_trylock(&m)); in TEST()
270 ASSERT_EQ(thrd_success, mtx_unlock(&m)); in TEST()
271 ASSERT_EQ(thrd_success, mtx_unlock(&m)); in TEST()
273 mtx_destroy(&m); in TEST()
281 mtx_t m; in TEST()
282 ASSERT_EQ(thrd_success, mtx_init(&m, mtx_timed)); in TEST()
285 ASSERT_EQ(thrd_success, mtx_timedlock(&m, &ts)); in TEST()
287 std::thread([&m] { in TEST()
289 ASSERT_EQ(thrd_timedout, mtx_timedlock(&m, &ts)); in TEST()
292 ASSERT_EQ(thrd_success, mtx_unlock(&m)); in TEST()
293 mtx_destroy(&m); in TEST()
302 mtx_t m; in TEST()
303 ASSERT_EQ(thrd_success, mtx_init(&m, mtx_plain)); in TEST()
304 ASSERT_EQ(thrd_success, mtx_lock(&m)); in TEST()
305 std::thread([&m] { in TEST()
306 ASSERT_EQ(thrd_busy, mtx_trylock(&m)); in TEST()
308 ASSERT_EQ(thrd_success, mtx_unlock(&m)); in TEST()
309 std::thread([&m] { in TEST()
310 ASSERT_EQ(thrd_success, mtx_trylock(&m)); in TEST()