suit: start worker thread on demand, make suit_handle_url() public
Contribution description
Drop the need to call suit_worker_run() before calling suit_worker_trigger() - the thread only has a single purpose anyway.
Also make the suit_handle_url() function available to users who already have a sufficiently large stack, when no worker thread should be started at all.
Testing procedure
Issues/PRs references
How about using an event thread instead, which could also be reused for other stuff?
My only concern there is that events are usually short tasks - if we'd use the event thread for installing the update, that would block other events for a long time.
I'm not sure if anything on the system level relies on the event thread though, so this would then only block user applications which is probably fine.
The main idea behind this is that we now export suit_handle_url(), so if the user already has a thread with a sufficient stack size, they can just use that and skip the dedicated worker thread.
I'm not sure if anything on the system level relies on the event thread though, so this would then only block user applications which is probably fine.
Hm, that's one thing I like about the extra thread, that updating doesn't stop the application.
Well with this the user can just call suit_handle_url() from the event thread if they so desire - with #18656 just a single event_callback_oneshot() is needed.
So I think we don't have to mandate the event thread for this.
@maribu thank you!