osal
osal copied to clipboard
fix: hold mutex when signaling cond var
If mutex is not held when signalling the condition variable, a thread woken up by the mutex unlock, may have lower priority than the thread waiting on the condition leading to priority inversion.
We also don't need to wake up waiters when we clear events, since this will never trigger return from the wait.