Create simple thread library

This commit is contained in:
Piotr Krygier committed 2023-08-14 14:49:57 +02:00
1 parent 3d538eaa2c
commit 507db80fb1
7 files changed
+63 -4

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
/**
* @file rse_task.h
* @author Piotr Krygier (everyonecancode@gmail.com)
* @brief Threads wrapper
* @version 0.1
* @date 2023-08-14
*
* @copyright Copyright (c) 2023
*
*/
#ifndef RSE_THREADS_H
#define RSE_THREADS_H
#include <stdint.h>
#ifdef __linux__
#include <pthread.h>
typedef pthread_t rse_thread_t;
#endif
typedef void*(*thread_worker_t)(void*);
uint8_t rse_create_task(rse_thread_t* thread_id, thread_worker_t callback, void* args);
uint8_t rse_task_join(rse_thread_t* thread_id);
void rse_task_delay(void);
#endif /* RSE_THREADS_H */