mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-03-13 22:32:01 +00:00
Make mutex and cond functions no-op with NULL pointers
This commit is contained in:
parent
83560485d1
commit
7fcbe073c3
1 changed files with 15 additions and 0 deletions
|
@ -297,6 +297,9 @@ I_lock_mutex (
|
|||
if (! i_threads_running.value)
|
||||
return;
|
||||
|
||||
if (anchor == NULL)
|
||||
return;
|
||||
|
||||
mutex = Identity(
|
||||
&i_mutex_pool,
|
||||
i_mutex_pool_mutex,
|
||||
|
@ -315,6 +318,9 @@ I_unlock_mutex (
|
|||
if (! i_threads_running.value)
|
||||
return;
|
||||
|
||||
if (id == NULL)
|
||||
return;
|
||||
|
||||
if (SDL_UnlockMutex(id) == -1)
|
||||
abort();
|
||||
}
|
||||
|
@ -329,6 +335,9 @@ I_hold_cond (
|
|||
if (! i_threads_running.value)
|
||||
return;
|
||||
|
||||
if (cond_anchor == NULL || mutex_id == NULL)
|
||||
return;
|
||||
|
||||
cond = Identity(
|
||||
&i_cond_pool,
|
||||
i_cond_pool_mutex,
|
||||
|
@ -349,6 +358,9 @@ I_wake_one_cond (
|
|||
if (! i_threads_running.value)
|
||||
return;
|
||||
|
||||
if (anchor == NULL)
|
||||
return;
|
||||
|
||||
cond = Identity(
|
||||
&i_cond_pool,
|
||||
i_cond_pool_mutex,
|
||||
|
@ -369,6 +381,9 @@ I_wake_all_cond (
|
|||
if (! i_threads_running.value)
|
||||
return;
|
||||
|
||||
if (anchor == NULL)
|
||||
return;
|
||||
|
||||
cond = Identity(
|
||||
&i_cond_pool,
|
||||
i_cond_pool_mutex,
|
||||
|
|
Loading…
Reference in a new issue