pthread: fix pthread_mutex_destroy() breaking priority inheritance
This commit is contained in:
parent
95e43fc2c4
commit
22d636b7b0
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue