- * Waits for the object to be signaled (using vlc_object_signal()).
- * If the object already has a signal pending, this function will return
- * immediately. It is asserted that the caller holds the object lock.
- *
- * @return true if the object is dying and should terminate.
- */
-bool __vlc_object_wait( vlc_object_t *obj )
-{
- vlc_assert_locked( &obj->object_lock );
- vlc_cond_wait( &obj->object_wait, &obj->object_lock );
- return obj->b_die;
-}
-
-
-/**
- * Waits for the object to be signaled (using vlc_object_signal()), or for
- * a timer to expire.
- * If the object already has a signal pending, this function will return
- * immediately. It is asserted that the caller holds the object lock.
- *
- * @return negative if the object is dying and should terminate,
- * positive if the the object has been signaled but is not dying,
- * 0 if timeout has been reached.
- */
-int __vlc_object_timedwait( vlc_object_t *obj, mtime_t deadline )
-{
- int v;
-
- vlc_assert_locked( &obj->object_lock );
- v = vlc_cond_timedwait( &obj->object_wait, &obj->object_lock, deadline );
- if( v == 0 ) /* signaled */
- return obj->b_die ? -1 : 1;
- return 0;
-}
-
-
-/**
- * Checks whether an object has been "killed".
- * The object lock must be held.
- *
- * Typical code for an object thread could be:
- *
- vlc_object_lock (self);
- ...initialization...
- while (vlc_object_alive (self))
- {
- ...preprocessing...
-
- if (vlc_object_wait (self))
- continue;
-
- ...postprocessing...
- }
- ...deinitialization...
- vlc_object_unlock (self);
- *
- *
- * @return true iff the object has not been killed yet
- */
-bool __vlc_object_alive( vlc_object_t *obj )
-{
- vlc_assert_locked( &obj->object_lock );
- return !obj->b_die;
-}
-
-
-/**
- * Signals an object for which the lock is held.
- */
-void __vlc_object_signal_unlocked( vlc_object_t *obj )
-{
- vlc_assert_locked (&obj->object_lock);
- vlc_cond_signal( &obj->object_wait );
-}
-
-
-/**
- * Requests termination of an object.
- * If the object is LibVLC, also request to terminate all its children.