mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-04-15 06:40:51 +00:00
Don't work on mutexes or conditions if threads are stopped
This commit is contained in:
parent
346f5c95f5
commit
db417a8761
1 changed files with 15 additions and 0 deletions
|
@ -284,6 +284,9 @@ I_lock_mutex (
|
|||
){
|
||||
SDL_mutex * mutex;
|
||||
|
||||
if (! i_threads_running.value)
|
||||
return;
|
||||
|
||||
mutex = Identity(
|
||||
&i_mutex_pool,
|
||||
i_mutex_pool_mutex,
|
||||
|
@ -299,6 +302,9 @@ void
|
|||
I_unlock_mutex (
|
||||
I_mutex id
|
||||
){
|
||||
if (! i_threads_running.value)
|
||||
return;
|
||||
|
||||
if (SDL_UnlockMutex(id) == -1)
|
||||
abort();
|
||||
}
|
||||
|
@ -310,6 +316,9 @@ I_hold_cond (
|
|||
){
|
||||
SDL_cond * cond;
|
||||
|
||||
if (! i_threads_running.value)
|
||||
return;
|
||||
|
||||
cond = Identity(
|
||||
&i_cond_pool,
|
||||
i_cond_pool_mutex,
|
||||
|
@ -327,6 +336,9 @@ I_wake_one_cond (
|
|||
){
|
||||
SDL_cond * cond;
|
||||
|
||||
if (! i_threads_running.value)
|
||||
return;
|
||||
|
||||
cond = Identity(
|
||||
&i_cond_pool,
|
||||
i_cond_pool_mutex,
|
||||
|
@ -344,6 +356,9 @@ I_wake_all_cond (
|
|||
){
|
||||
SDL_cond * cond;
|
||||
|
||||
if (! i_threads_running.value)
|
||||
return;
|
||||
|
||||
cond = Identity(
|
||||
&i_cond_pool,
|
||||
i_cond_pool_mutex,
|
||||
|
|
Loading…
Reference in a new issue