Skip to content
Snippets Groups Projects
Commit bdddeb9e authored by James R.'s avatar James R.
Browse files

Create cond if it doesn't exist when signaling

parent 88bcac01
No related branches found
No related tags found
No related merge requests found
......@@ -32,8 +32,8 @@ void I_unlock_mutex (I_mutex);
void I_hold_cond (I_cond *, I_mutex);
void I_wake_one_cond (I_cond);
void I_wake_all_cond (I_cond);
void I_wake_one_cond (I_cond *);
void I_wake_all_cond (I_cond *);
#endif/*I_THREADS_H*/
#endif/*HAVE_THREADS*/
......@@ -323,16 +323,34 @@ I_hold_cond (
void
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();
}
void
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();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment