From: Nick Mathewson Date: Wed, 18 Aug 2010 16:02:25 +0000 (-0400) Subject: Fix logic error in win32 TRY_LOCK that caused problems with rate-limiting X-Git-Tag: release-2.0.7-rc~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c32b9de2c707beaf09178e0b7793efa3f585669;p=libevent Fix logic error in win32 TRY_LOCK that caused problems with rate-limiting --- diff --git a/evthread_win32.c b/evthread_win32.c index 12b8c1e6..795f410f 100644 --- a/evthread_win32.c +++ b/evthread_win32.c @@ -67,7 +67,7 @@ evthread_win32_lock(unsigned mode, void *_lock) { CRITICAL_SECTION *lock = _lock; if ((mode & EVTHREAD_TRY)) { - return TryEnterCriticalSection(lock) != 0; + return ! TryEnterCriticalSection(lock); } else { EnterCriticalSection(lock); return 0;