mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-13 05:06:30 +04:00
add missing api [ci skip]
This commit is contained in:
17
lib/toolbox/run_parallel.c
Normal file
17
lib/toolbox/run_parallel.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "run_parallel.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static void run_parallel_thread_state(FuriThread* thread, FuriThreadState state, void* context) {
|
||||
UNUSED(context);
|
||||
|
||||
if(state == FuriThreadStateStopped) {
|
||||
furi_thread_free(thread);
|
||||
}
|
||||
}
|
||||
|
||||
void run_parallel(FuriThreadCallback callback, void* context, uint32_t stack_size) {
|
||||
FuriThread* thread = furi_thread_alloc_ex(NULL, stack_size, callback, context);
|
||||
furi_thread_set_state_callback(thread, run_parallel_thread_state);
|
||||
furi_thread_start(thread);
|
||||
}
|
||||
Reference in New Issue
Block a user