You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In your ReadWriteLock you should check the return values of your xSemaphoreTake() calls to be prone against spurious wakeups. For example if you call vTaskAbortDelay() to wake up a sleeping task from another, it will also cancel your waits on the semaphore. Unfortunately that behaviour is not really documented, but I've ran into it - took me a while.
I do it like so
while (xSemaphoreTake(sem, portMAX_DELAY) != pdTRUE) {}
The text was updated successfully, but these errors were encountered:
Hi, @dns13 , I don't think the change I made could fix the problem you described.
Before my change, a task waiting for a notification with portMAX_DELAY may be identified as suspended, and this task could be woke up by vTaskResume. After my change, this task could not be woke up by vTaskResume.
A task waiting for something(semaphore/event/notify) with portMAX_DELAY still could be woke up by xTaskAbortDelay.
In your ReadWriteLock you should check the return values of your xSemaphoreTake() calls to be prone against spurious wakeups. For example if you call vTaskAbortDelay() to wake up a sleeping task from another, it will also cancel your waits on the semaphore. Unfortunately that behaviour is not really documented, but I've ran into it - took me a while.
I do it like so
while (xSemaphoreTake(sem, portMAX_DELAY) != pdTRUE) {}
The text was updated successfully, but these errors were encountered: