pthread: fix the priority inheritance (backport v3.3)

This commit is contained in:
xutao
2020-11-19 15:30:49 +08:00
parent 77119a793e
commit cf4eba2f5d

View File

@ -591,6 +591,15 @@ 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);