diff options
| author | Aldrik Ramaekers <aldrik.ramaekers@protonmail.com> | 2020-02-05 18:58:55 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik.ramaekers@protonmail.com> | 2020-02-05 18:58:55 +0100 |
| commit | 8c2f35bd1f18b62fff609f3a7d77d4e85b706916 (patch) | |
| tree | 93e504989bd6182b1b381f1c9bd1b46e0732169a /src/thread.h | |
| parent | ec901c42d7d5dee13b4c69e4b65fc385d8ffd3a8 (diff) | |
refactor
Diffstat (limited to 'src/thread.h')
| -rw-r--r-- | src/thread.h | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/src/thread.h b/src/thread.h deleted file mode 100644 index b019fdb..0000000 --- a/src/thread.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -* BSD 2-Clause “Simplified” License -* Copyright (c) 2019, Aldrik Ramaekers, aldrik.ramaekers@protonmail.com -* All rights reserved. -*/ - -#ifndef INCLUDE_THREAD -#define INCLUDE_THREAD - -#ifdef OS_LINUX -#include <pthread.h> -#include <unistd.h> -#include <sys/types.h> -#include <sys/syscall.h> - -struct t_thread -{ - pthread_t thread; - bool valid; -}; - -struct t_mutex -{ - pthread_mutex_t mutex; -}; -#endif - -#ifdef OS_WIN -#include <windows.h> -#include <process.h> /* _beginthread, _endthread */ -#include <stddef.h> -#include <stdlib.h> -#include <conio.h> - -struct t_thread -{ - HANDLE thread; - bool valid; -}; - -struct t_mutex -{ - HANDLE mutex; -}; -#endif - -typedef struct t_thread thread; -typedef struct t_mutex mutex; - -thread thread_start(void *(*start_routine) (void *), void *arg); -void thread_join(thread *thread); -bool thread_tryjoin(thread *thread); -void thread_detach(thread *thread); -void thread_stop(thread *thread); -u32 thread_get_id(); -void thread_sleep(u64 microseconds); - -mutex mutex_create_recursive(); -mutex mutex_create(); - -void mutex_lock(mutex *mutex); -bool mutex_trylock(mutex *mutex); -void mutex_unlock(mutex *mutex); - -void mutex_destroy(mutex *mutex); - -#endif
\ No newline at end of file |
