I am a bit confused:
g_cond_timed_wait(*Cond, *mutex, *abs_time) is used mostly in threads to wait either until the Cond is signaled or wait time (abs_time) expired.
In the definition of this function the documentation says:
"...the mutex is unlocked before falling asleep and locked again before resuming...". This is obvious, so the mutex in the other thread would unloc while this thread is sleeping.
Now in many code examples I see this:
IfOKresponse = g_cond_timed_wait(my_cond, data_mutex, &end_time);
That is, they lock the mutex just before g_cond_timed_wat() to be unlocked by the g_cond_timed_wait function right away.
Does it make sense?