pthread: fix pthread_mutex_destroy() breaking priority inheritance

This commit is contained in:
Michael Balzer 2020-07-24 14:45:48 +02:00
parent 95e43fc2c4
commit 22d636b7b0

View file

@ -591,7 +591,12 @@ int pthread_mutex_destroy(pthread_mutex_t *mutex)
return EBUSY;
}
// FreeRTOS mutex must not be deleted while taken (breaks priority inheritance):
vTaskSuspendAll();
pthread_mutex_unlock(mutex);
vSemaphoreDelete(mux->sem);
xTaskResumeAll();
free(mux);
return 0;