@@ -114,10 +114,20 @@ #elif defined(_WIN32) EnterCriticalSection(mutex); return YES; #endif } + +static OF_INLINE BOOL +of_mutex_trylock(of_mutex_t *mutex) +{ +#if defined(OF_HAVE_PTHREADS) + return (pthread_mutex_trylock(mutex) ? NO : YES); +#elif defined(_WIN32) + return (TryEnterCriticalSection(mutex) ? YES : NO); +#endif +} static OF_INLINE BOOL of_mutex_unlock(of_mutex_t *mutex) { #if defined(OF_HAVE_PTHREADS)