mirror of
https://github.com/openmv/openmv.git
synced 2025-09-26 23:09:13 +08:00
Revert "common/mutex: Clear tid when releasing mutex"
This reverts commit bb52288561
.
Event though this fixes a deadlock in the new protocol, it
actually breaks fair locking as one side could lock multiple
times in a row.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
parent
085f282e4b
commit
1b59e95162
@ -55,7 +55,6 @@ bool mutex_try_lock_fair(mutex_t *m, size_t tid) {
|
||||
|
||||
void mutex_unlock(mutex_t *m, size_t tid) {
|
||||
if (atomic_load_explicit(&m->tid, memory_order_acquire) == tid) {
|
||||
atomic_store_explicit(&m->tid, 0, memory_order_relaxed);
|
||||
atomic_flag_clear_explicit(&m->lock, memory_order_release);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user