* @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. */
| 68 | * (when FUTEX_PRIVATE flag is set) or global futex unlocking mechanism. |
| 69 | */ |
| 70 | static 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 |
no test coverage detected