diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2009-03-30 20:55:27 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2009-03-30 20:55:27 +0200 |
commit | 9010a500e7b1c8e7f16b0093b7cf456e07dd7d85 (patch) | |
tree | 0e820ee840edebc01a0483bc856adf7923d8c950 /src | |
parent | e9df4bc8972f69815e1dd6fe19e1162a9a97b092 (diff) | |
download | wolfbones-9010a500e7b1c8e7f16b0093b7cf456e07dd7d85.tar.gz wolfbones-9010a500e7b1c8e7f16b0093b7cf456e07dd7d85.tar.bz2 |
mutexes on native Windows
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.W32 | 6 | ||||
-rw-r--r-- | src/mutex.c | 14 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/Makefile.W32 b/src/Makefile.W32 index 25d6eb0..5d46c75 100644 --- a/src/Makefile.W32 +++ b/src/Makefile.W32 @@ -24,10 +24,14 @@ LOG_OBJS = \ SERVICE_OBJS = \ service\service.obj +THREADING_OBJS = \ + mutex.obj + OBJS = \ $(PORT_OBJS) \ $(LOG_OBJS) \ - $(SERVICE_OBJS) + $(SERVICE_OBJS) \ + $(THREADING_OBJS) local_all: $(LIBRARIES) diff --git a/src/mutex.c b/src/mutex.c index 5aa18cf..573dc2c 100644 --- a/src/mutex.c +++ b/src/mutex.c @@ -76,3 +76,17 @@ wolf_error_t wolf_mutex_destroy( wolf_mutex_t *mutex ) { } #endif /* defined HAVE_PTHREADS */ + +#if defined _WIN32 + +wolf_error_t wolf_mutex_init( wolf_mutex_t *mutex ) { + InitializeCriticalSection( mutex ); + return WOLF_OK; +} + +wolf_error_t wolf_mutex_destroy( wolf_mutex_t *mutex ) { + DeleteCriticalSection( mutex ); + return WOLF_OK; +} + +#endif /* defined _WIN32 */ |