mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
pthread: fix the priority inheritance
When `pthread_mutex_destroy` is used to release mutex, `pthread_mutex_lock_internal` is used, which results in the increase of `uxmutexehold` and no recovery base priority
This commit is contained in:
parent
db0fec51e8
commit
28ca70cce5
@ -593,6 +593,14 @@ int pthread_mutex_destroy(pthread_mutex_t *mutex)
|
|||||||
return EBUSY;
|
return EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mux->type == PTHREAD_MUTEX_RECURSIVE) {
|
||||||
|
res = xSemaphoreGiveRecursive(mux->sem);
|
||||||
|
} else {
|
||||||
|
res = xSemaphoreGive(mux->sem);
|
||||||
|
}
|
||||||
|
if (res != pdTRUE) {
|
||||||
|
assert(false && "Failed to release mutex!");
|
||||||
|
}
|
||||||
vSemaphoreDelete(mux->sem);
|
vSemaphoreDelete(mux->sem);
|
||||||
free(mux);
|
free(mux);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user