mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-13 05:11:01 +00:00
Create cond if it doesn't exist when signaling
This commit is contained in:
parent
88bcac0168
commit
bdddeb9ecf
2 changed files with 24 additions and 6 deletions
|
@ -32,8 +32,8 @@ void I_unlock_mutex (I_mutex);
|
||||||
|
|
||||||
void I_hold_cond (I_cond *, I_mutex);
|
void I_hold_cond (I_cond *, I_mutex);
|
||||||
|
|
||||||
void I_wake_one_cond (I_cond);
|
void I_wake_one_cond (I_cond *);
|
||||||
void I_wake_all_cond (I_cond);
|
void I_wake_all_cond (I_cond *);
|
||||||
|
|
||||||
#endif/*I_THREADS_H*/
|
#endif/*I_THREADS_H*/
|
||||||
#endif/*HAVE_THREADS*/
|
#endif/*HAVE_THREADS*/
|
||||||
|
|
|
@ -323,16 +323,34 @@ I_hold_cond (
|
||||||
|
|
||||||
void
|
void
|
||||||
I_wake_one_cond (
|
I_wake_one_cond (
|
||||||
I_cond id
|
I_cond * anchor
|
||||||
){
|
){
|
||||||
if (SDL_CondSignal(id) == -1)
|
SDL_cond * cond;
|
||||||
|
|
||||||
|
cond = Identity(
|
||||||
|
&i_cond_pool,
|
||||||
|
i_cond_pool_mutex,
|
||||||
|
anchor,
|
||||||
|
(Create_fn)SDL_CreateCond
|
||||||
|
);
|
||||||
|
|
||||||
|
if (SDL_CondSignal(cond) == -1)
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
I_wake_all_cond (
|
I_wake_all_cond (
|
||||||
I_cond id
|
I_cond * anchor
|
||||||
){
|
){
|
||||||
if (SDL_CondBroadcast(id) == -1)
|
SDL_cond * cond;
|
||||||
|
|
||||||
|
cond = Identity(
|
||||||
|
&i_cond_pool,
|
||||||
|
i_cond_pool_mutex,
|
||||||
|
anchor,
|
||||||
|
(Create_fn)SDL_CreateCond
|
||||||
|
);
|
||||||
|
|
||||||
|
if (SDL_CondBroadcast(cond) == -1)
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue