summaryrefslogtreecommitdiff
path: root/librabbitmq/win32/threads.c
diff options
context:
space:
mode:
Diffstat (limited to 'librabbitmq/win32/threads.c')
-rw-r--r--librabbitmq/win32/threads.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/librabbitmq/win32/threads.c b/librabbitmq/win32/threads.c
index 0501408..1559c5f 100644
--- a/librabbitmq/win32/threads.c
+++ b/librabbitmq/win32/threads.c
@@ -11,8 +11,9 @@ int
pthread_mutex_init(pthread_mutex_t *mutex, void *attr)
{
*mutex = malloc(sizeof(CRITICAL_SECTION));
- if (!*mutex)
+ if (!*mutex) {
return 1;
+ }
InitializeCriticalSection(*mutex);
return 0;
}
@@ -20,8 +21,9 @@ pthread_mutex_init(pthread_mutex_t *mutex, void *attr)
int
pthread_mutex_lock(pthread_mutex_t *mutex)
{
- if (!*mutex)
+ if (!*mutex) {
return 1;
+ }
EnterCriticalSection(*mutex);
return 0;
@@ -30,8 +32,9 @@ pthread_mutex_lock(pthread_mutex_t *mutex)
int
pthread_mutex_unlock(pthread_mutex_t *mutex)
{
- if (!*mutex)
+ if (!*mutex) {
return 1;
+ }
LeaveCriticalSection(*mutex);
return 0;