Files
RedScarfEngine/utilities/task.h
T
Piotr Krygier 173a82b9d1 [WIP] Refactor project
There are many problems with the way the current version is provided
and maintained. This commit or series of commits will fix this.
2025-06-20 13:44:33 +02:00

28 lines
517 B
C

/**
* @file task.h
* @author Piotr Krygier (everyonecancode@gmail.com)
* @brief Threads wrapper
* @version 0.1
* @date 2023-08-14
*
* @copyright Copyright (c) 2023
*
*/
#ifndef THREADS_H
#define THREADS_H
#include <stdint.h>
#ifdef __linux__
#include <pthread.h>
typedef pthread_t thread_t;
#endif
typedef void*(*thread_worker_t)(void*);
uint8_t create_task(thread_t* thread_id, thread_worker_t callback, void* args);
uint8_t task_join(thread_t* thread_id);
void task_exit(void);
#endif /* THREADS_H */