Lines Matching refs:lock
29 void __retarget_lock_init_recursive(_LOCK_T *lock) in __retarget_lock_init_recursive() argument
31 __ASSERT_NO_MSG(lock != NULL); in __retarget_lock_init_recursive()
35 *lock = malloc(sizeof(struct k_mutex)); in __retarget_lock_init_recursive()
37 *lock = k_object_alloc(K_OBJ_MUTEX); in __retarget_lock_init_recursive()
39 __ASSERT(*lock != NULL, "recursive lock allocation failed"); in __retarget_lock_init_recursive()
41 k_mutex_init((struct k_mutex *)*lock); in __retarget_lock_init_recursive()
45 void __retarget_lock_init(_LOCK_T *lock) in __retarget_lock_init() argument
47 __retarget_lock_init_recursive(lock); in __retarget_lock_init()
51 void __retarget_lock_close_recursive(_LOCK_T lock) in __retarget_lock_close_recursive() argument
53 __ASSERT_NO_MSG(lock != NULL); in __retarget_lock_close_recursive()
55 free(lock); in __retarget_lock_close_recursive()
57 k_object_release(lock); in __retarget_lock_close_recursive()
62 void __retarget_lock_close(_LOCK_T lock) in __retarget_lock_close() argument
64 __retarget_lock_close_recursive(lock); in __retarget_lock_close()
68 void __retarget_lock_acquire_recursive(_LOCK_T lock) in __retarget_lock_acquire_recursive() argument
70 __ASSERT_NO_MSG(lock != NULL); in __retarget_lock_acquire_recursive()
71 k_mutex_lock((struct k_mutex *)lock, K_FOREVER); in __retarget_lock_acquire_recursive()
75 void __retarget_lock_acquire(_LOCK_T lock) in __retarget_lock_acquire() argument
77 __retarget_lock_acquire_recursive(lock); in __retarget_lock_acquire()
81 int __retarget_lock_try_acquire_recursive(_LOCK_T lock) in __retarget_lock_try_acquire_recursive() argument
83 __ASSERT_NO_MSG(lock != NULL); in __retarget_lock_try_acquire_recursive()
84 return !k_mutex_lock((struct k_mutex *)lock, K_NO_WAIT); in __retarget_lock_try_acquire_recursive()
88 int __retarget_lock_try_acquire(_LOCK_T lock) in __retarget_lock_try_acquire() argument
90 return __retarget_lock_try_acquire_recursive(lock); in __retarget_lock_try_acquire()
94 void __retarget_lock_release_recursive(_LOCK_T lock) in __retarget_lock_release_recursive() argument
96 __ASSERT_NO_MSG(lock != NULL); in __retarget_lock_release_recursive()
97 k_mutex_unlock((struct k_mutex *)lock); in __retarget_lock_release_recursive()
101 void __retarget_lock_release(_LOCK_T lock) in __retarget_lock_release() argument
103 __retarget_lock_release_recursive(lock); in __retarget_lock_release()