Lines Matching refs:mtx
7 static mutex_t mtx; variable
18 assert(mutex_is_locked(&mtx) == 0); in ktest_mutex_case0()
19 mutex_lock(&mtx); in ktest_mutex_case0()
20 assert(mutex_is_locked(&mtx) == 1); in ktest_mutex_case0()
21 mutex_unlock(&mtx); in ktest_mutex_case0()
22 assert(mutex_is_locked(&mtx) == 0); in ktest_mutex_case0()
23 assert(mutex_trylock(&mtx) == 1); in ktest_mutex_case0()
24 mutex_unlock(&mtx); in ktest_mutex_case0()
25 assert(mutex_is_locked(&mtx) == 0); in ktest_mutex_case0()
37 assert(mutex_is_locked(&mtx) == 1); in ktest_mutex_case1_pid1()
38 mutex_lock(&mtx); in ktest_mutex_case1_pid1()
39 assert(atomic_read(&mtx.count) == 0); in ktest_mutex_case1_pid1()
40 assert(list_empty(&mtx.wait_list)); in ktest_mutex_case1_pid1()
42 mutex_unlock(&mtx); in ktest_mutex_case1_pid1()
49 if (!assert(mutex_is_locked(&mtx) == 0)) in ktest_mutex_case1()
53 mutex_lock(&mtx); in ktest_mutex_case1()
58 while (list_empty(&mtx.wait_list)) in ktest_mutex_case1()
62 assert(atomic_read(&mtx.count) == 0); in ktest_mutex_case1()
63 … struct mutex_waiter_t *wt = container_of(list_next(&mtx.wait_list), struct mutex_waiter_t, list); in ktest_mutex_case1()
66 mutex_unlock(&mtx); in ktest_mutex_case1()
84 mutex_init(&mtx); in ktest_test_mutex()