Lines Matching full:mutex
11 #include <zephyr/sys/mutex.h>
25 SYS_MUTEX_DEFINE(mutex);
28 /* The order of threads getting mutex is judged by index
42 /* Keep mutex for a while */ in low_prio_wait_for_mutex()
57 /* Keep mutex for a while */ in high_prio_t1_wait_for_mutex()
72 /* Keep mutex for a while */ in high_prio_t2_wait_for_mutex()
79 * @brief Test multi-threads to take mutex.
85 * 1. Any number of threads may wait on a mutex locked by others
87 * 2. When the mutex is released, it is took by the highest priority
99 sys_mutex_lock(&mutex, K_NO_WAIT); in ZTEST()
105 &mutex, NULL, NULL, in ZTEST()
113 &mutex, NULL, NULL, in ZTEST()
118 &mutex, NULL, NULL, in ZTEST()
121 /* Release mutex by current thread */ in ZTEST()
122 sys_mutex_unlock(&mutex); in ZTEST()
129 /* The mutex should be keep by high prio t1 thread */ in ZTEST()
131 "The highest priority thread failed to take the mutex."); in ZTEST()
133 /* The mutex should be keep by high prio t2 thread */ in ZTEST()
135 "The higher priority thread failed to take the mutex."); in ZTEST()
137 /* The mutex should be keep by low prio thread */ in ZTEST()
139 "The low priority thread failed to take the mutex."); in ZTEST()