1
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:
MX
2025-02-13 20:20:25 +03:00
parent d4830270a4
commit dea16b7055
4 changed files with 32 additions and 0 deletions

View 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);
}