Logo Search packages:      
Sourcecode: ardour version File versions

bool Glib::Cond::timed_wait ( Mutex mutex,
const Glib::TimeVal abs_time 

Waits until this thread is woken up on this Cond, but not longer than until the time, that is specified by abs_time. The mutex is unlocked before falling asleep and locked again before resuming.

This function can also be used, if Glib::thread_init() has not yet been called and will immediately return true then.

mutex a Mutex that is currently locked.
abs_time a max time to wait.
It is important to use the wait() and timed_wait() methods only inside a loop, which checks for the condition to be true as it is not guaranteed that the waiting thread will find it fulfilled, even if the signaling thread left the condition in that state. This is because another thread can have altered the condition, before the waiting thread got the chance to be woken up, even if the condition itself is protected by a Mutex.

Definition at line 365 of file thread.cc.

References Glib::Mutex::gobj().

  return g_cond_timed_wait(gobject_, mutex.gobj(), const_cast<Glib::TimeVal*>(&abs_time));

Generated by  Doxygen 1.6.0   Back to index