Fix Recursive Mutexes to handle ThreadID==0 (bug #779)
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1884 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
Changes towards version 0.5:
|
||||
- Fixed Recursive Mutexes to still work even if the ThreadID is 0
|
||||
(bug 779) - Michael
|
||||
- Permit independent selection of graphics driver and resolution in
|
||||
setup menu - Michael
|
||||
- Changed comm subtitle caching to use own context instead of
|
||||
|
||||
@@ -547,7 +547,7 @@ LockRecursiveMutex_SDL (RecursiveMutex val)
|
||||
{
|
||||
RecM *mtx = (RecM *)val;
|
||||
Uint32 thread_id = SDL_ThreadID();
|
||||
if (mtx->thread_id != thread_id)
|
||||
if (!mtx->locks || mtx->thread_id != thread_id)
|
||||
{
|
||||
#ifdef TRACK_CONTENTION
|
||||
if (mtx->thread_id && (mtx->syncClass & TRACK_CONTENTION_CLASSES))
|
||||
@@ -567,7 +567,7 @@ UnlockRecursiveMutex_SDL (RecursiveMutex val)
|
||||
{
|
||||
RecM *mtx = (RecM *)val;
|
||||
Uint32 thread_id = SDL_ThreadID();
|
||||
if (mtx->thread_id != thread_id)
|
||||
if (!mtx->locks || mtx->thread_id != thread_id)
|
||||
{
|
||||
#ifdef NAMED_SYNCHRO
|
||||
fprintf (stderr, "'%s' attempted to unlock %s when it didn't hold it\n", MyThreadName (), mtx->name);
|
||||
|
||||
Reference in New Issue
Block a user