]> granicus.if.org Git - libevent/commitdiff
Fix logic error in win32 TRY_LOCK that caused problems with rate-limiting
authorNick Mathewson <nickm@torproject.org>
Wed, 18 Aug 2010 16:02:25 +0000 (12:02 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 18 Aug 2010 16:02:25 +0000 (12:02 -0400)
evthread_win32.c

index 12b8c1e6cd955ff565f0d7f392600b59d7bdedfc..795f410fde9877792a48d8d6054b6efd70c70340 100644 (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;