mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 21:10:06 -04:00
Fix logic error in win32 TRY_LOCK that caused problems with rate-limiting
This commit is contained in:
parent
d0b884338f
commit
4c32b9de2c
@ -67,7 +67,7 @@ evthread_win32_lock(unsigned mode, void *_lock)
|
|||||||
{
|
{
|
||||||
CRITICAL_SECTION *lock = _lock;
|
CRITICAL_SECTION *lock = _lock;
|
||||||
if ((mode & EVTHREAD_TRY)) {
|
if ((mode & EVTHREAD_TRY)) {
|
||||||
return TryEnterCriticalSection(lock) != 0;
|
return ! TryEnterCriticalSection(lock);
|
||||||
} else {
|
} else {
|
||||||
EnterCriticalSection(lock);
|
EnterCriticalSection(lock);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user