1
mirror of https://github.com/flipperdevices/flipperzero-firmware.git synced 2025-12-13 05:19:50 +04:00

Threading, Timers improvements (#3865)

* FuriTimer: Use a local variable to wait for deletion

This combines the current synchronous behaviour
(as we could have deferred the free call too) with
a smaller FuriTimer - it's safe to pass a pointer to
a local variable to this pending timer call, because we
know it'll be finished before the caller returns

* Tighten the use of FuriThread* vs FuriThreadId

Event loop and Loader mixed those two,
but the fact those are aliases should be an implementation detail.
For this reason, thread.c is still allowed to mix them freely.
This commit is contained in:
Silent
2024-09-07 20:18:51 +02:00
committed by GitHub
parent 8672a1d94c
commit 8c2223df5d
5 changed files with 46 additions and 30 deletions

View File

@@ -65,7 +65,10 @@ static void furi_event_loop_timer_enqueue_request(
TimerQueue_push_back(instance->timer_queue, timer);
xTaskNotifyIndexed(
instance->thread_id, FURI_EVENT_LOOP_FLAG_NOTIFY_INDEX, FuriEventLoopFlagTimer, eSetBits);
(TaskHandle_t)instance->thread_id,
FURI_EVENT_LOOP_FLAG_NOTIFY_INDEX,
FuriEventLoopFlagTimer,
eSetBits);
}
/*