Skip to content
This repository was archived by the owner on Feb 17, 2022. It is now read-only.

Commit 96a051c

Browse files
author
Eduard Batmendijn
committed
Fix mutex ownership if SDL_CondWaitTimeout times out
1 parent 0e96067 commit 96a051c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/thread/pthread/SDL_syscond.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,14 @@ SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
134134
retval = SDL_MUTEX_TIMEDOUT;
135135
break;
136136
case 0:
137-
#if FAKE_RECURSIVE_MUTEX
138-
mutex->owner = pthread_self();
139-
mutex->recursive = 0;
140-
#endif
141137
break;
142138
default:
143139
retval = SDL_SetError("pthread_cond_timedwait() failed");
144140
}
141+
#if FAKE_RECURSIVE_MUTEX
142+
mutex->owner = pthread_self();
143+
mutex->recursive = 0;
144+
#endif
145145
return retval;
146146
}
147147

0 commit comments

Comments
 (0)