Files
Momentum-Firmware/lib/toolbox/run_parallel.h
Willy-JL 674956a476 Toolbox: Add run_parallel() util
Runs a self-cleaning-up thread without boilerplate
Same paradigm used in existing code like region and rpc services
Not replaced there to avoid merge conflicts
Not exposed to API for now
2024-08-12 00:29:12 +02:00

13 lines
413 B
C

#pragma once
#include <core/thread.h>
/**
* @brief Run function in thread, then automatically clean up thread.
*
* @param[in] callback pointer to a function to be executed in parallel
* @param[in] context pointer to a user-specified object (will be passed to the callback)
* @param[in] stack_size stack size in bytes
*/
void run_parallel(FuriThreadCallback callback, void* context, uint32_t stack_size);