Lines Matching refs:completion
49 static rt_err_t _comp_susp_thread(struct rt_completion *completion,
58 void rt_completion_init(struct rt_completion *completion) in rt_completion_init() argument
60 RT_ASSERT(completion != RT_NULL); in rt_completion_init()
62 IPC_STORE(&completion->susp_thread_n_flag, RT_UNCOMPLETED, in rt_completion_init()
83 rt_err_t rt_completion_wait_flags_noisr(struct rt_completion *completion, in rt_completion_wait_flags_noisr() argument
90 RT_ASSERT(completion != RT_NULL); in rt_completion_wait_flags_noisr()
102 IPC_CAS(&completion->susp_thread_n_flag, &expected_value, in rt_completion_wait_flags_noisr()
131 &completion->susp_thread_n_flag, &expected_value, in rt_completion_wait_flags_noisr()
137 result = _comp_susp_thread(completion, thread, timeout, in rt_completion_wait_flags_noisr()
140 RT_ASSERT(rt_atomic_load(&completion->susp_thread_n_flag) != in rt_completion_wait_flags_noisr()
177 rt_err_t rt_completion_wait_flags(struct rt_completion *completion, in rt_completion_wait_flags() argument
183 error = rt_completion_wait_flags_noisr(completion, timeout, suspend_flag); in rt_completion_wait_flags()
188 static rt_base_t _wait_until_update(struct rt_completion *completion, rt_base_t expected) in _wait_until_update() argument
197 IPC_LOAD(&completion->susp_thread_n_flag, memory_order_relaxed); in _wait_until_update()
206 static rt_err_t _comp_susp_thread(struct rt_completion *completion, in _comp_susp_thread() argument
225 RT_ASSERT(rt_atomic_load(&completion->susp_thread_n_flag) == in _comp_susp_thread()
227 IPC_STORE(&completion->susp_thread_n_flag, RT_UNCOMPLETED, in _comp_susp_thread()
234 RT_ASSERT(rt_atomic_load(&completion->susp_thread_n_flag) == in _comp_susp_thread()
236 IPC_STORE(&completion->susp_thread_n_flag, comp_waiting, in _comp_susp_thread()
265 RT_ASSERT(rt_atomic_load(&completion->susp_thread_n_flag) != in _comp_susp_thread()
273 if (!IPC_CAS(&completion->susp_thread_n_flag, &comp_waiting, in _comp_susp_thread()
280 _wait_until_update(completion, RT_WAKING); in _comp_susp_thread()
301 rt_err_t rt_completion_wakeup_by_errno(struct rt_completion *completion, in rt_completion_wakeup_by_errno() argument
308 RT_ASSERT(completion != RT_NULL); in rt_completion_wakeup_by_errno()
316 IPC_CAS(&completion->susp_thread_n_flag, &expected_value, in rt_completion_wakeup_by_errno()
341 &completion->susp_thread_n_flag, &expected_value, in rt_completion_wakeup_by_errno()
355 RT_ASSERT(rt_atomic_load(&completion->susp_thread_n_flag) == in rt_completion_wakeup_by_errno()
357 IPC_STORE(&completion->susp_thread_n_flag, RT_UNCOMPLETED, in rt_completion_wakeup_by_errno()