Lines Matching full:mutex
15 * @brief Create and Initialize a Mutex object.
19 struct k_mutex *mutex; in osMutexCreate() local
29 if (k_mem_slab_alloc(&cmsis_mutex_slab, (void **)&mutex, K_MSEC(100)) == 0) { in osMutexCreate()
30 (void)memset(mutex, 0, sizeof(struct k_mutex)); in osMutexCreate()
35 k_mutex_init(mutex); in osMutexCreate()
37 return (osMutexId)mutex; in osMutexCreate()
41 * @brief Wait until a Mutex becomes available.
45 struct k_mutex *mutex = (struct k_mutex *) mutex_id; in osMutexWait() local
57 status = k_mutex_lock(mutex, K_FOREVER); in osMutexWait()
59 status = k_mutex_lock(mutex, K_NO_WAIT); in osMutexWait()
61 status = k_mutex_lock(mutex, K_MSEC(timeout)); in osMutexWait()
74 * @brief Release a Mutex that was obtained by osMutexWait.
78 struct k_mutex *mutex = (struct k_mutex *) mutex_id; in osMutexRelease() local
88 if (k_mutex_unlock(mutex) != 0) { in osMutexRelease()
96 * @brief Delete a Mutex that was created by osMutexCreate.
100 struct k_mutex *mutex = (struct k_mutex *) mutex_id; in osMutexDelete() local
110 /* The status code "osErrorResource" (mutex object could in osMutexDelete()
114 k_mem_slab_free(&cmsis_mutex_slab, (void *)mutex); in osMutexDelete()