Merge branch 'bugfix/backport_v4.2_fix_pthread_priority_inheritance' into 'release/v4.2'

pthread: fix the priority inheritance (backport v4.2)

See merge request espressif/esp-idf!11260
This commit is contained in:
Angus Gratton 2020-12-08 09:07:23 +08:00
commit 8a47006b72

View File

@ -593,6 +593,15 @@ int pthread_mutex_destroy(pthread_mutex_t *mutex)
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);
free(mux);