mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-08 02:13:29 +00:00
wasnt needed
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@694 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
/* $Id$ */
|
||||
#include <Mw/Milsko.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
void* MwMutexCreate(void) {
|
||||
return CreateEvent(NULL, FALSE, TRUE, NULL);
|
||||
}
|
||||
|
||||
void MwMutexDestroy(void* handle) {
|
||||
CloseHandle(handle);
|
||||
}
|
||||
|
||||
void MwMutexLock(void* handle) {
|
||||
WaitForSingleObject(handle, INFINITE);
|
||||
}
|
||||
|
||||
void MwMutexUnlock(void* handle) {
|
||||
SetEvent(handle);
|
||||
}
|
||||
#elif defined(__unix__)
|
||||
#include <pthread.h>
|
||||
|
||||
void* MwMutexCreate(void) {
|
||||
pthread_mutex_t* m = malloc(sizeof(*m));
|
||||
|
||||
pthread_mutex_init(m, NULL);
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
void MwMutexDestroy(void* handle) {
|
||||
pthread_mutex_destroy(handle);
|
||||
|
||||
free(handle);
|
||||
}
|
||||
|
||||
void MwMutexLock(void* handle) {
|
||||
pthread_mutex_lock(handle);
|
||||
}
|
||||
|
||||
void MwMutexUnlock(void* handle) {
|
||||
pthread_mutex_unlock(handle);
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user