We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3258

Summary: SDL_TryLockMutex blocks for pthreads with FAKE_RECURSIVE_MUTEX
Product: SDL Reporter: Ian Abbott <abbotti>
Component: threadAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.1   
Hardware: All   
OS: All   

Description Ian Abbott 2016-02-11 17:38:23 UTC
I just spotted what I think is a bug in "src/thread/pthread/SDL_sysmutex.c" in the SDL_TryLockMutex function when FAKE_RECURSIVE_MUTEX is defined (for an implementation of Pthreads with no recursive mutex support).  It calls pthread_mutex_lock instead of pthread_mutex_trylock, so it will block until the mutex is available instead of returning SDL_MUTEX_TIMEDOUT if it cannot lock the mutex immediately.
Comment 1 Sam Lantinga 2017-08-12 04:47:45 UTC
Good catch, thanks!
https://hg.libsdl.org/SDL/rev/554b2c683da2