MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _suspend_thread_locked

Function _suspend_thread_locked

components/lwp/lwp_futex.c:475–485  ·  view source on GitHub ↗

* @brief Add current thread into futex waiting thread list * * @param[in] thread The thread to be suspended * @param[in] futex The futex to add thread to waiting list * * @return rt_err_t Returns RT_EOK on success or error code on failure */

Source from the content-addressed store, hash-verified

473 * @return rt_err_t Returns RT_EOK on success or error code on failure
474 */
475static rt_err_t _suspend_thread_locked(rt_thread_t thread, rt_futex_t futex)
476{
477 /**
478 * Brief: Add current thread into futex waiting thread list
479 *
480 * Note: Critical Section
481 * - the futex waiting_thread list (RW)
482 */
483 return rt_thread_suspend_to_list(thread, &futex->waiting_thread,
484 RT_IPC_FLAG_FIFO, RT_INTERRUPTIBLE);
485}
486
487/**
488 * @brief Compare and exchange futex value atomically

Callers 1

_futex_waitFunction · 0.85

Calls 1

Tested by

no test coverage detected