windows support
This commit is contained in:
parent
f1cd631aae
commit
b9004acd79
16 changed files with 208 additions and 32 deletions
22
core/mutex.c
Normal file
22
core/mutex.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#include <MDE/Core/Mutex.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
|
||||
MDEMutex MDEMutexCreate(void) {
|
||||
return CreateEvent(NULL, FALSE, TRUE, NULL);
|
||||
}
|
||||
|
||||
void MDEMutexDestroy(MDEMutex mutex) {
|
||||
CloseHandle(mutex);
|
||||
}
|
||||
|
||||
void MDEMutexLock(MDEMutex mutex) {
|
||||
WaitForSingleObject(mutex, INFINITE);
|
||||
}
|
||||
|
||||
void MDEMutexUnlock(MDEMutex mutex) {
|
||||
SetEvent(mutex);
|
||||
}
|
||||
#else
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue