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 - SDL_TryLockMutex blocks for pthreads with FAKE_RECURSIVE_MUTEX
Summary: SDL_TryLockMutex blocks for pthreads with FAKE_RECURSIVE_MUTEX
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: thread (show other bugs)
Version: HG 2.1
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-11 17:38 UTC by Ian Abbott
Modified: 2017-08-12 04:47 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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