fixed try_lock on windows

This commit is contained in:
oy 2012-07-19 10:01:57 +02:00
parent 521eaf038b
commit 6c8e097bb2

View file

@ -477,7 +477,7 @@ int lock_try(LOCK lock)
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
return pthread_mutex_trylock((LOCKINTERNAL *)lock); return pthread_mutex_trylock((LOCKINTERNAL *)lock);
#elif defined(CONF_FAMILY_WINDOWS) #elif defined(CONF_FAMILY_WINDOWS)
return TryEnterCriticalSection((LPCRITICAL_SECTION)lock); return !TryEnterCriticalSection((LPCRITICAL_SECTION)lock);
#else #else
#error not implemented on this platform #error not implemented on this platform
#endif #endif