mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
fix(esp_event): clear running_task before releasing mutex on tick timeout
When esp_event_loop_run() exited via the ticks-expired break path, loop->running_task was left pointing to the current task handle. Any subsequent trylock in esp_event_handler_unregister_with_internal() would see a stale non-NULL running_task and take the wrong code path.
This commit is contained in:
@@ -728,6 +728,7 @@ esp_err_t esp_event_loop_run(esp_event_loop_handle_t event_loop, TickType_t tick
|
||||
remaining_ticks -= end - marker;
|
||||
// If the ticks to run expired, return to the caller
|
||||
if (remaining_ticks <= 0) {
|
||||
loop->running_task = NULL;
|
||||
xSemaphoreGiveRecursive(loop->mutex);
|
||||
break;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user