From ffd5987e7ce83a21186d1c73d3d7b2cca0c34371 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 26 Apr 2016 01:43:00 +0200 Subject: [PATCH] Proper lock test on Windows --- src/libsodium/sodium/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsodium/sodium/core.c b/src/libsodium/sodium/core.c index ae6ed071..79004ef0 100644 --- a/src/libsodium/sodium/core.c +++ b/src/libsodium/sodium/core.c @@ -83,7 +83,7 @@ static int _sodium_crit_enter(void) { if (InterlockedCompareExchange(&_sodium_lock_initialized, - 1L, 0L) != 0L) { + 1L, 0L) == 0L) { InitializeCriticalSection(_sodium_lock); InterlockedIncrement(&_sodium_lock_initialized); } else {