make platform objects typesafer and add mutex

This commit is contained in:
RSDuck
2020-11-03 19:40:14 +01:00
parent 052079afeb
commit 2720df9650
3 changed files with 56 additions and 22 deletions

View File

@ -67,15 +67,24 @@ inline bool LocalFileExists(const char* name)
return true;
}
void* Thread_Create(void (*func)());
void Thread_Free(void* thread);
void Thread_Wait(void* thread);
struct Thread;
Thread* Thread_Create(void (*func)());
void Thread_Free(Thread* thread);
void Thread_Wait(Thread* thread);
void* Semaphore_Create();
void Semaphore_Free(void* sema);
void Semaphore_Reset(void* sema);
void Semaphore_Wait(void* sema);
void Semaphore_Post(void* sema);
struct Semaphore;
Semaphore* Semaphore_Create();
void Semaphore_Free(Semaphore* sema);
void Semaphore_Reset(Semaphore* sema);
void Semaphore_Wait(Semaphore* sema);
void Semaphore_Post(Semaphore* sema);
struct Mutex;
Mutex* Mutex_Create();
void Mutex_Free(Mutex* mutex);
void Mutex_Lock(Mutex* mutex);
void Mutex_Unlock(Mutex* mutex);
bool Mutex_TryLock(Mutex* mutex);
void* GL_GetProcAddress(const char* proc);