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

Function _futex_unlock

components/lwp/lwp_futex.c:70–86  ·  view source on GitHub ↗

* @brief Unlocks the global futex with specified operation flags * * @param[in] lwp Pointer to the lightweight process structure * @param[in] op_flags Operation flags (e.g., FUTEX_PRIVATE) * * @note This function handles unlocking of futexes, either using process-local unlocking * (when FUTEX_PRIVATE flag is set) or global futex unlocking mechanism. */

Source from the content-addressed store, hash-verified

68 * (when FUTEX_PRIVATE flag is set) or global futex unlocking mechanism.
69 */
70static void _futex_unlock(rt_lwp_t lwp, int op_flags)
71{
72 rt_err_t error;
73 if (op_flags & FUTEX_PRIVATE)
74 {
75 LWP_UNLOCK(lwp);
76 }
77 else
78 {
79 error = lwp_mutex_release_safe(&_glob_futex);
80 if (error)
81 {
82 LOG_E("%s: Should not failed", __func__);
83 RT_ASSERT(0);
84 }
85 }
86}
87
88/**
89 * @brief Destroys a private futex and releases its resources

Callers 6

_sftx_getFunction · 0.85
_futex_waitFunction · 0.85
_futex_wakeFunction · 0.85
_futex_lock_piFunction · 0.85
_futex_unlock_piFunction · 0.85
lwp_futexFunction · 0.85

Calls 1

lwp_mutex_release_safeFunction · 0.85

Tested by

no test coverage detected