From 9010a500e7b1c8e7f16b0093b7cf456e07dd7d85 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Mon, 30 Mar 2009 20:55:27 +0200 Subject: mutexes on native Windows --- src/Makefile.W32 | 6 +++++- src/mutex.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'src') 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 */ -- cgit v1.2.3-54-g00ecf