Fix logic error in win32 TRY_LOCK that caused problems with rate-limiting

This commit is contained in:
Nick Mathewson 2010-08-18 12:02:25 -04:00
parent d0b884338f
commit 4c32b9de2c

View File

@ -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;