Initial commit, yay
This commit is contained in:
commit
25e26756cd
85 changed files with 7077 additions and 0 deletions
23
src/threading/os_mutex.h
Normal file
23
src/threading/os_mutex.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
#ifndef OS_MUTEX_H
|
||||
#define OS_MUTEX_H
|
||||
|
||||
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) // Fuck you, apple
|
||||
|
||||
#include <pthread.h>
|
||||
typedef pthread_mutex_t os_mutex_t;
|
||||
|
||||
#elif defined(_WIN32)
|
||||
|
||||
#include <windows.h>
|
||||
typedef HANDLE os_mutex_t;
|
||||
|
||||
#else
|
||||
#error "Unknown Threading Standard, feel free to add support via a fork/PR"
|
||||
#endif
|
||||
|
||||
int OSMutex_Create(os_mutex_t* target);
|
||||
int OSMutex_Acquire(os_mutex_t* mutex);
|
||||
int OSMutex_Release(os_mutex_t* mutex);
|
||||
int OSMutex_Destroy(os_mutex_t* mutex);
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue