vlc_threads.h File Reference

This file defines structures and functions for handling threads in vlc. More...

Include dependency graph for vlc_threads.h:

Go to the source code of this file.

Defines

#define LIBVLC_USE_PTHREAD   1
#define LIBVLC_USE_PTHREAD_CANCEL   1
#define _APPLE_C_SOURCE   1
#define VLC_THREAD_PRIORITY_LOW   0
#define VLC_THREAD_PRIORITY_INPUT   10
#define VLC_THREAD_PRIORITY_AUDIO   5
#define VLC_THREAD_PRIORITY_VIDEO   0
#define VLC_THREAD_PRIORITY_OUTPUT   15
#define VLC_THREAD_PRIORITY_HIGHEST   20
#define VLC_STATIC_MUTEX   PTHREAD_MUTEX_INITIALIZER
#define vlc_cleanup_push(routine, arg)   pthread_cleanup_push (routine, arg)
 Registers a new procedure to run if the thread is cancelled (or otherwise exits prematurely).
#define vlc_cleanup_pop()   pthread_cleanup_pop (0)
 Removes a cleanup procedure that was previously registered with vlc_cleanup_push().
#define vlc_cleanup_run()   pthread_cleanup_pop (1)
 Removes a cleanup procedure that was previously registered with vlc_cleanup_push(), and executes it.
#define mutex_cleanup_push(lock)   vlc_cleanup_push (vlc_cleanup_lock, lock)
#define vlc_spin_lock   vlc_mutex_lock
#define vlc_spin_unlock   vlc_mutex_unlock
#define vlc_spin_destroy   vlc_mutex_destroy
#define vlc_thread_create(P_THIS, PSZ_NAME, FUNC, PRIORITY)   vlc_thread_create( VLC_OBJECT(P_THIS), __FILE__, __LINE__, PSZ_NAME, FUNC, PRIORITY )
#define vlc_thread_set_priority(P_THIS, PRIORITY)   __vlc_thread_set_priority( VLC_OBJECT(P_THIS), __FILE__, __LINE__, PRIORITY )
#define vlc_thread_join(P_THIS)   __vlc_thread_join( VLC_OBJECT(P_THIS) )

Typedefs

typedef pthread_t vlc_thread_t
typedef pthread_mutex_t vlc_mutex_t
typedef pthread_cond_t vlc_cond_t
typedef sem_t vlc_sem_t
typedef pthread_rwlock_t vlc_rwlock_t
typedef pthread_key_t vlc_threadvar_t
typedef struct vlc_timervlc_timer_t
typedef vlc_mutex_t vlc_spinlock_t

Functions

void vlc_mutex_init (vlc_mutex_t *)
void vlc_mutex_init_recursive (vlc_mutex_t *)
void vlc_mutex_destroy (vlc_mutex_t *)
 Destroys a mutex.
void vlc_mutex_lock (vlc_mutex_t *)
 Acquires a mutex.
int vlc_mutex_trylock (vlc_mutex_t *)
 Acquires a mutex if and only if it is not currently held by another thread.
void vlc_mutex_unlock (vlc_mutex_t *)
 Releases a mutex (or crashes if the mutex is not locked by the caller).
void vlc_cond_init (vlc_cond_t *)
void vlc_cond_destroy (vlc_cond_t *)
 Destroys a condition variable.
void vlc_cond_signal (vlc_cond_t *)
 Wakes up one thread waiting on a condition variable, if any.
void vlc_cond_broadcast (vlc_cond_t *)
 Wakes up all threads (if any) waiting on a condition variable.
void vlc_cond_wait (vlc_cond_t *, vlc_mutex_t *)
 Waits for a condition variable.
int vlc_cond_timedwait (vlc_cond_t *, vlc_mutex_t *, mtime_t)
 Waits for a condition variable up to a certain date.
void vlc_sem_init (vlc_sem_t *, unsigned)
 Initializes a semaphore.
void vlc_sem_destroy (vlc_sem_t *)
 Destroys a semaphore.
int vlc_sem_post (vlc_sem_t *)
 Increments the value of a semaphore.
void vlc_sem_wait (vlc_sem_t *)
 Atomically wait for the semaphore to become non-zero (if needed), then decrements it.
void vlc_rwlock_init (vlc_rwlock_t *)
 Initializes a read/write lock.
void vlc_rwlock_destroy (vlc_rwlock_t *)
 Destroys an initialized unused read/write lock.
void vlc_rwlock_rdlock (vlc_rwlock_t *)
 Acquires a read/write lock for reading.
void vlc_rwlock_wrlock (vlc_rwlock_t *)
 Acquires a read/write lock for writing.
void vlc_rwlock_unlock (vlc_rwlock_t *)
 Releases a read/write lock.
int vlc_threadvar_create (vlc_threadvar_t *, void(*)(void *))
 Allocates a thread-specific variable.
void vlc_threadvar_delete (vlc_threadvar_t *)
int vlc_threadvar_set (vlc_threadvar_t, void *)
 Sets a thread-specific variable.
void * vlc_threadvar_get (vlc_threadvar_t)
 Gets the value of a thread-local variable for the calling thread.
int vlc_thread_create (vlc_object_t *, const char *, int, const char *, void *(*)(vlc_object_t *), int)
int __vlc_thread_set_priority (vlc_object_t *, const char *, int, int)
void __vlc_thread_join (vlc_object_t *)
int vlc_clone (vlc_thread_t *, void *(*)(void *), void *, int)
void vlc_cancel (vlc_thread_t)
 Marks a thread as cancelled.
void vlc_join (vlc_thread_t, void **)
 Waits for a thread to complete (if needed), then destroys it.
void vlc_control_cancel (int cmd,...)
int vlc_timer_create (vlc_timer_t *, void(*)(void *), void *)
 Initializes an asynchronous timer.
void vlc_timer_destroy (vlc_timer_t)
 Destroys an initialized timer.
void vlc_timer_schedule (vlc_timer_t, bool, mtime_t, mtime_t)
 Arm or disarm an initialized timer.
unsigned vlc_timer_getoverrun (vlc_timer_t)
 Fetch and reset the overrun counter for a timer.
int vlc_savecancel (void)
 Save the current cancellation state (enabled or disabled), then disable cancellation for the calling thread.
void vlc_restorecancel (int state)
 Restore the cancellation state for the calling thread.
void vlc_testcancel (void)
 Issues an explicit deferred cancellation point.
static void vlc_cleanup_lock (void *lock)
static void vlc_spin_init (vlc_spinlock_t *spin)
static void barrier (void)
 Issues a full memory barrier.


Detailed Description

This file defines structures and functions for handling threads in vlc.


Define Documentation

#define _APPLE_C_SOURCE   1

#define LIBVLC_USE_PTHREAD   1

#define LIBVLC_USE_PTHREAD_CANCEL   1

#define mutex_cleanup_push ( lock   )     vlc_cleanup_push (vlc_cleanup_lock, lock)

 
#define vlc_cleanup_pop (  )     pthread_cleanup_pop (0)

#define vlc_cleanup_push ( routine,
arg   )     pthread_cleanup_push (routine, arg)

Registers a new procedure to run if the thread is cancelled (or otherwise exits prematurely).

Any call to vlc_cleanup_push() must paired with a call to either vlc_cleanup_pop() or vlc_cleanup_run(). Branching into or out of the block between these two function calls is not allowed (read: it will likely crash the whole process). If multiple procedures are registered, they are handled in last-in first-out order.

Parameters:
routine procedure to call if the thread ends
arg argument for the procedure

Referenced by ALSAThread(), rtp_thread(), Run(), Thread(), and TsRun().

 
#define vlc_cleanup_run (  )     pthread_cleanup_pop (1)

Removes a cleanup procedure that was previously registered with vlc_cleanup_push(), and executes it.

Referenced by block_FifoShow(), rtp_thread(), Run(), Thread(), and TsRun().

#define vlc_spin_destroy   vlc_mutex_destroy

#define vlc_spin_lock   vlc_mutex_lock

#define vlc_spin_unlock   vlc_mutex_unlock

#define VLC_STATIC_MUTEX   PTHREAD_MUTEX_INITIALIZER

#define vlc_thread_create ( P_THIS,
PSZ_NAME,
FUNC,
PRIORITY   )     vlc_thread_create( VLC_OBJECT(P_THIS), __FILE__, __LINE__, PSZ_NAME, FUNC, PRIORITY )

#define vlc_thread_join ( P_THIS   )     __vlc_thread_join( VLC_OBJECT(P_THIS) )

#define VLC_THREAD_PRIORITY_AUDIO   5

Referenced by input_DecoderNew().

#define VLC_THREAD_PRIORITY_HIGHEST   20

Referenced by Open().

#define VLC_THREAD_PRIORITY_INPUT   10

#define VLC_THREAD_PRIORITY_LOW   0

#define VLC_THREAD_PRIORITY_OUTPUT   15

#define VLC_THREAD_PRIORITY_VIDEO   0

Referenced by EncodeVideo(), and input_DecoderNew().

#define vlc_thread_set_priority ( P_THIS,
PRIORITY   )     __vlc_thread_set_priority( VLC_OBJECT(P_THIS), __FILE__, __LINE__, PRIORITY )


Typedef Documentation

typedef pthread_cond_t vlc_cond_t

typedef pthread_mutex_t vlc_mutex_t

typedef pthread_rwlock_t vlc_rwlock_t

typedef sem_t vlc_sem_t

typedef pthread_t vlc_thread_t

typedef pthread_key_t vlc_threadvar_t

typedef struct vlc_timer* vlc_timer_t


Function Documentation

void __vlc_thread_join ( vlc_object_t  ) 

int __vlc_thread_set_priority ( vlc_object_t ,
const char *  ,
int  ,
int   
)

static void barrier ( void   )  [inline, static]

void vlc_cancel ( vlc_thread_t  thread_id  ) 

Marks a thread as cancelled.

Next time the target thread reaches a cancellation point (while not having disabled cancellation), it will run its cancellation cleanup handler, the thread variable destructors, and terminate. vlc_join() must be used afterward regardless of a thread being cancelled or not.

References vlc_cancel_self().

Referenced by Close(), libvlc_event_async_fini(), MMSTUClose(), vlc_thread_cancel(), and vlc_timer_schedule().

static void vlc_cleanup_lock ( void *  lock  )  [inline, static]

References vlc_mutex_unlock().

int vlc_clone ( vlc_thread_t ,
void *  *)(void *,
void *  ,
int   
)

void vlc_cond_broadcast ( vlc_cond_t p_condvar  ) 

Wakes up all threads (if any) waiting on a condition variable.

Parameters:
p_cond condition variable

Referenced by block_FifoEmpty(), block_FifoGet(), block_FifoWake(), event_async_loop(), TriggerCallback(), vlc_rwlock_unlock(), vout_snapshot_End(), and vout_snapshot_Set().

void vlc_cond_destroy ( vlc_cond_t p_condvar  ) 

void vlc_cond_init ( vlc_cond_t  ) 

void vlc_cond_signal ( vlc_cond_t p_condvar  ) 

int vlc_cond_timedwait ( vlc_cond_t p_condvar,
vlc_mutex_t p_mutex,
mtime_t  deadline 
)

Waits for a condition variable up to a certain date.

This works like vlc_cond_wait(), except for the additional timeout.

Parameters:
p_condvar condition variable to wait on
p_mutex mutex which is unlocked while waiting, then locked again when waking up.
deadline absolute timeout
Returns:
0 if the condition was signaled, an error code in case of timeout.

References CLOCK_FREQ, lldiv(), mdate(), lldiv_t::quot, lldiv_t::rem, vlc_testcancel(), and VLC_THREAD_ASSERT.

Referenced by AudioStreamChangeFormat(), ControlPop(), DecoderWaitDate(), BDAOutput::Pop(), Run(), RunThread(), CThread::ThreadSleep(), vout_snapshot_Get(), and WaitPreparsed().

void vlc_cond_wait ( vlc_cond_t p_condvar,
vlc_mutex_t p_mutex 
)

Waits for a condition variable.

The calling thread will be suspended until another thread calls vlc_cond_signal() or vlc_cond_broadcast() on the same condition variable, the thread is cancelled with vlc_cancel(), or the system causes a "spurious" unsolicited wake-up.

A mutex is needed to wait on a condition variable. It must not be a recursive mutex. Although it is possible to use the same mutex for multiple condition, it is not valid to use different mutexes for the same condition variable at the same time from different threads.

In case of thread cancellation, the mutex is always locked before cancellation proceeds.

The canonical way to use a condition variable to wait for event foobar is:

   vlc_mutex_lock (&lock);
   mutex_cleanup_push (&lock); // release the mutex in case of cancellation

   while (!foobar)
       vlc_cond_wait (&wait, &lock);

   --- foobar is now true, do something about it here --

   vlc_cleanup_run (); // release the mutex

Parameters:
p_condvar condition variable to wait on
p_mutex mutex which is unlocked while waiting, then locked again when waking up.
deadline absolute timeout
Returns:
0 if the condition was signaled, an error code in case of timeout.

References vlc_testcancel(), and VLC_THREAD_ASSERT.

Referenced by __vout_Create(), block_FifoGet(), block_FifoPace(), block_FifoShow(), DecodeBlock(), DecoderFlush(), DecoderOpen(), DecoderThread(), DecoderWaitUnblock(), Demux(), ErrorThread(), event_async_loop(), EventThreadStart(), FfmpegExecute(), GetUnused(), VoutManager::getWindow(), input_DecoderWaitBuffering(), KeepAliveThread(), KillerThread(), libvlc_event_async_ensure_listener_removal(), libvlc_InternalWait(), LoopRequest(), OpenWindow(), playlist_fetcher_Delete(), playlist_preparser_Delete(), ReadCompressed(), VoutManager::releaseWindow(), rtmp_connect_active(), rtmp_connect_passive(), Run(), Thread(), TsRun(), vlc_rwlock_rdlock(), vlc_rwlock_wrlock(), vlc_timer_destroy(), vlclua_lock_and_wait(), and vout_NextPicture().

void vlc_control_cancel ( int  cmd,
  ... 
)

void vlc_join ( vlc_thread_t  handle,
void **  result 
)

Waits for a thread to complete (if needed), then destroys it.

This is a cancellation point; in case of cancellation, the join does _not_ occur.

Warning:
A thread cannot join itself (normally VLC will abort if this is attempted). Also, a detached thread cannot be joined.
Parameters:
handle thread handle
p_result [OUT] pointer to write the thread return value or NULL

References vlc_testcancel(), and VLC_THREAD_ASSERT.

Referenced by __vlc_thread_join(), Close(), Close_LuaIntf(), DecoderClose(), DecoderOpen(), EventThreadStart(), EventThreadStop(), libvlc_event_async_fini(), MMSTUClose(), playlist_Deactivate(), vlc_timer_schedule(), vlm_Destructor(), and vout_Close().

void vlc_mutex_destroy ( vlc_mutex_t p_mutex  ) 

Destroys a mutex.

The mutex must not be locked.

Parameters:
p_mutex mutex to destroy
Returns:
always succeeds

References VLC_THREAD_ASSERT.

Referenced by __vlm_New(), aout_DecDelete(), aout_Destructor(), AudioStreamChangeFormat(), block_FifoRelease(), Close(), Close_LuaIntf(), CloseDecoder(), CloseEncoder(), ClosePostproc(), CloseServer(), CloseVideo(), CommonClose(), CreateFilter(), Deactivate(), DecoderClose(), DecoderOpen(), DecSysRelease(), DeleteDecoder(), Destroy(), DestroyFilter(), Destructor(), DllMain(), End(), EsOutDelete(), demux_sys_t::EventThread(), EventThreadDestroy(), FreeMutex(), httpd_TLSHostNew(), input_clock_Delete(), input_item_Clean(), input_resource_Delete(), KillerThread(), libvlc_event_async_fini(), libvlc_event_manager_release(), libvlc_InternalDestroy(), libvlc_media_list_player_release(), libvlc_media_list_release(), libvlc_media_list_view_release(), libvlc_media_player_destroy(), libvlc_media_player_new(), libvlc_release(), main(), MediaDel(), MMSTUClose(), MMSTUOpen(), Open(), OpenServer(), picture_fifo_Delete(), playlist_Destructor(), playlist_fetcher_Delete(), playlist_preparser_Delete(), RtspUnsetup(), sout_DeleteInstance(), spu_Destroy(), transcode_video_close(), vlc_event_manager_fini(), vlc_module_destruct(), vlc_object_destroy(), vlc_rwlock_destroy(), vlc_timer_destroy(), vlm_Destructor(), vout_DeleteDisplay(), vout_Destructor(), vout_snapshot_Clean(), BDAOutput::~BDAOutput(), CAtmoDynData::~CAtmoDynData(), CAtmoExternalCaptureInput::~CAtmoExternalCaptureInput(), demux_sys_t::~demux_sys_t(), and FullscreenControllerWidget::~FullscreenControllerWidget().

void vlc_mutex_init ( vlc_mutex_t  ) 

void vlc_mutex_init_recursive ( vlc_mutex_t  ) 

void vlc_mutex_lock ( vlc_mutex_t p_mutex  ) 

Acquires a mutex.

If needed, waits for any other thread to release it. Beware of deadlocks when locking multiple mutexes at the same time, or when using mutexes from callbacks. This function is not a cancellation-point.

Parameters:
p_mutex mutex initialized with vlc_mutex_init() or vlc_mutex_init_recursive()

References vlc_mutex_init(), vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_THREAD_ASSERT.

Referenced by __config_GetPsz(), __config_LoadConfigFile(), __config_PutPsz(), __config_ResetAll(), __module_InitBank(), __osd_ButtonFind(), __osd_ButtonSelect(), __osd_MenuActivate(), __osd_MenuCreate(), __osd_MenuDelete(), __osd_MenuDown(), __osd_MenuHide(), __osd_MenuNext(), __osd_MenuPrev(), __osd_MenuShow(), __osd_MenuUp(), __osd_Volume(), __stats_TimerClean(), __stats_TimerDump(), __stats_TimersCleanAll(), __stats_TimersDumpAll(), __stats_TimerStart(), __stats_TimerStop(), __str_format_meta(), __var_AddCallback(), __var_Change(), __var_Create(), __var_DelCallback(), __var_Destroy(), __var_GetAndSet(), __var_TriggerCallback(), __var_Type(), __vlc_event_attach(), __vlc_object_kill(), __vlm_New(), __vout_Create(), __vout_Request(), AcquireDrawable(), ActiveKeyCallback(), Add(), AddOut(), AddToQueue(), AdjustCallback(), AllCallback(), aout_lock_input(), aout_lock_input_fifos(), aout_lock_mixer(), aout_lock_output_fifo(), aout_new_buffer(), AReadBlock(), AReadStream(), Art(), ArtCachePath(), AssHandleHold(), AssHandleRelease(), Atmo_Shutdown(), AudioStreamChangeFormat(), BandsCallback(), Block(), block_FifoEmpty(), block_FifoGet(), block_FifoPace(), block_FifoPut(), block_FifoShow(), block_FifoWake(), BlockDecode(), BluescreenCallback(), ButtonUpdate(), CacheChanged(), callback(), cb_delete(), cb_fetch(), cb_store(), ChangeKeyCallback(), Close(), Close_LuaIntf(), CloseDecoder(), CloseWindow(), CommandThread(), config_AutoSaveConfigFile(), Control(), ControlPop(), ControlReduce(), ControlReopenDevice(), VideoWindow::ControlWindow(), Create(), CreateFilter(), Decode(), DecodeBlock(), DecodePacket(), DecoderClose(), DecoderDecodeAudio(), DecoderDecodeVideo(), DecoderGetCc(), DecoderGetDisplayDate(), DecoderIsFlushing(), DecoderOpen(), DecoderPlayAudio(), DecoderPlaySout(), DecoderPlaySpu(), DecoderPlayVideo(), DecoderProcessOnFlush(), DecoderProcessSpu(), DecoderSignalBuffering(), DecoderThread(), DecoderWaitDate(), DecodeVideo(), DecOpen(), DecSysHold(), DecSysRelease(), Del(), DeleteDecoder(), CAtmoExternalCaptureInput::DeliverNewSourceDataPaket(), DelOut(), Demux(), DemuxFile(), DemuxOpen(), DesktopCallback(), DetachAout(), dialog_GetProvider(), dialog_Register(), dialog_Unregister(), DirectDrawUpdateOverlay(), DirectXEventProc(), DisplayVideo(), DoChildren(), DumpCommand(), End(), CapturePin::EndFlush(), EqzFilter(), EraseCallback(), EsOutAdd(), EsOutControl(), EsOutDel(), EsOutMeta(), EsOutProgramEpg(), EsOutSend(), event_attach(), demux_sys_t::EventKey(), EventKey(), demux_sys_t::EventMouse(), EventThread(), demux_sys_t::EventThread(), EventThreadGetAndResetHasMoved(), EventThreadRetreiveChanges(), EventThreadStart(), EventThreadStop(), EventThreadUpdateSourceAndPlace(), EventThreadUpdateTitle(), EventThreadUpdateWindowPosition(), EventThreadUseOverlay(), CAtmoLiveView::Execute(), CmdReleaseVoutWindow::execute(), CmdNewVoutWindow::execute(), ExtractCallback(), FakeCallback(), Fetch(), FfmpegExecute(), Filter(), FilterCallback(), FilterPacked(), FilterPlanar(), FilterSub(), FilterVideo(), AsyncQueue::flush(), FreePictureVec(), FullscreenControllerWidget::fullscreenChanged(), GatherPES(), GetInputMeta(), VideoWindow::GetWindow(), VoutManager::getWindow(), gnutls_Deinit(), gnutls_Init(), GradientCallback(), HoldAout(), HoldVout(), HoldVouts(), httpd_TLSHostNew(), Inhibit(), InitThread(), InitVideo(), input_clock_ChangePause(), input_clock_ChangeRate(), input_clock_ChangeSystemOrigin(), input_clock_ConvertTS(), input_clock_GetJitter(), input_clock_GetRate(), input_clock_GetState(), input_clock_GetWakeup(), input_clock_Reset(), input_clock_SetJitter(), input_clock_Update(), input_ControlPush(), input_DecoderChangeDelay(), input_DecoderChangePause(), input_DecoderDelete(), input_DecoderFrameNext(), input_DecoderGetCcState(), input_DecoderHasFormatChanged(), input_DecoderIsCcPresent(), input_DecoderSetCcState(), input_DecoderStartBuffering(), input_DecoderStopBuffering(), input_DecoderWaitBuffering(), input_ExtractAttachmentAndCacheArt(), input_item_AddInfo(), input_item_AddOption(), input_item_AddSubItem(), input_item_CopyOptions(), input_item_DelInfo(), input_item_GetDuration(), input_item_GetInfo(), input_item_GetMeta(), input_item_GetName(), input_item_GetTitleFbName(), input_item_GetURI(), input_item_HasErrorWhenReading(), input_item_IsArtFetched(), input_item_IsPreparsed(), input_item_MetaMatch(), input_item_NewWithType(), input_item_SetArtFetched(), input_item_SetArtNotFound(), input_item_SetDuration(), input_item_SetEpg(), input_item_SetEpgOffline(), input_item_SetErrorWhenReading(), input_item_SetMeta(), input_item_SetName(), input_item_SetPreparsed(), input_item_SetURI(), input_item_WriteMeta(), input_resource_Detach(), input_resource_HasVout(), input_resource_RequestAout(), input_resource_RequestSout(), input_resource_RequestVout(), input_resource_SetInput(), input_Stop(), input_UpdateStatistic(), input_vaControl(), InputSourceInit(), InputSourceMeta(), intf_Create(), intf_DestroyAll(), ItemChange(), KeepAliveThread(), KeyEvent(), KillerThread(), libvlc_event_async_dispatch(), libvlc_event_detach(), libvlc_event_manager_register_event_type(), libvlc_event_send(), libvlc_InternalCreate(), libvlc_InternalDestroy(), libvlc_InternalWait(), libvlc_lock(), libvlc_media_list_lock(), libvlc_media_list_media(), libvlc_media_list_release(), libvlc_media_list_retain(), libvlc_media_list_set_media(), libvlc_media_list_view_event_manager(), libvlc_media_list_view_parent_media_list(), libvlc_media_list_view_release(), libvlc_media_list_view_retain(), libvlc_Quit(), libvlc_release(), libvlc_retain(), libvlc_setup_threads(), lock(), CAtmoDynData::LockCriticalSection(), LogoCallback(), main(), MainLoopInterface(), Manage(), MarqueeCallback(), MaskCallback(), media_player_reached_end(), MediaAddES(), MediaDel(), MediaDelES(), MediaNew(), mms_CommandSend(), module_EndBank(), MosaicCallback(), Mouse(), MouseEvent(), msg_Create(), msg_Destroy(), mvar_InfoSetNew(), ItemInfoDialog::OnOk(), onSystrayChange(), onTaskBarChange(), OnTopCallback(), Opaque(), Open(), OpenAudio(), OpenDecoder(), OpenVideo(), OpenWindow(), ParseExecute(), picture_fifo_Flush(), picture_fifo_OffsetDate(), picture_fifo_Peek(), picture_fifo_Pop(), picture_fifo_Push(), playlist_fetcher_Delete(), playlist_fetcher_Push(), playlist_LiveSearchUpdateInternal(), playlist_Lock(), playlist_preparser_Delete(), playlist_preparser_Push(), PlaylistNext(), Position(), PositionChanged(), PostprocPict(), PPChangeMode(), PreampCallback(), Preparse(), PresetCallback(), process_server_message(), MessagesView::Pulse(), AsyncQueue::push(), PushPicture(), PuzzleCallback(), queue_lock(), RateChanged(), Raw1394Handler(), ReadCompressed(), ReadMetaData(), CapturePin::Receive(), Redraw(), ReleaseDrawable(), VideoWindow::ReleaseWindow(), VoutManager::releaseWindow(), Render(), RequestAout(), RequestPage(), RequestVout(), rtmp_connect_active(), rtmp_connect_passive(), rtmp_handler_invoke(), rtp_process(), rtp_thread(), RtspDelId(), RtspHandler(), Run(), RunIntf(), RunThread(), SaveConfigFile(), ScalingCallback(), SDLCallback(), SendIn(), SendOut(), FullscreenControllerWidget::setVoutList(), SharpenCallback(), sout_AnnounceRegisterSDP(), sout_AnnounceUnRegister(), sout_InputDelete(), sout_InputNew(), sout_InputSendBuffer(), spu_DisplaySubpicture(), spu_new_buffer(), spu_OffsetSubtitleDate(), spu_RenderSubpictures(), spu_SortSubpictures(), SpuClearChannel(), SpuControl(), StateCallback(), StateChanged(), Statistics(), stats_ComputeInputStats(), stats_DumpInputStats(), stats_ReinitInputStats(), StillTimer(), StreamListener(), SubFilterCallback(), SwitchDisplay(), CThread::Terminate(), Thread(), ThreadControl(), ThreadSend(), CThread::ThreadSleep(), transcode_video_close(), transcode_video_process(), TriggerCallback(), TSDate(), TsRun(), TwoPassCallback(), uninstall_media_player_observer(), InputStatsPanel::update(), ExtraMetaPanel::update(), UpdateBookmarksOption(), FileInfo::UpdateFileInfo(), ItemInfoDialog::UpdateInfo(), UpdateRegions(), UpdateSPU(), updateStatistics(), VLCInfo::updateStatistics:, UrlsChange(), var_GetChecked(), var_SetChecked(), video_del_buffer_filter(), video_widget_ready(), VideoFilter2Callback(), vlc_avcodec_mutex(), vlc_event_detach(), vlc_event_manager_register_event_type(), vlc_event_send(), vlc_gcrypt_init(), vlc_mutex_lock(), vlc_mutex_trylock(), vlc_object_get_name(), vlc_object_set_name(), vlc_object_waitpipe(), vlc_osso_unblank(), vlc_rwlock_rdlock(), vlc_rwlock_unlock(), vlc_rwlock_wrlock(), vlc_threads_setup(), vlc_timer_destroy(), vlc_timer_do(), vlc_timer_getoverrun(), vlc_timer_schedule(), vlc_timer_thread(), vlclua_lock_and_wait(), vlm_Control(), vlm_Delete(), vlm_ExecuteCommand(), vlm_MediaVodControl(), vnc_worker_thread(), VolumeChanged(), vout_AreDisplayPicturesInvalid(), vout_ChangePause(), vout_Close(), vout_CountPictureAvailable(), vout_CreatePicture(), vout_DestroyPicture(), vout_DisplayPicture(), vout_DisplayTitle(), vout_DropPicture(), vout_FixLeaks(), vout_Flush(), vout_LinkPicture(), vout_ManageDisplay(), vout_new_buffer(), vout_NextPicture(), vout_SetDisplayFullscreen(), vout_SetDisplayOnTop(), vout_snapshot_End(), vout_snapshot_Get(), vout_snapshot_Set(), vout_UnlinkPicture(), VoutDisplayEvent(), VoutDisplayEventMouse(), WaitPreparsed(), and WindowOpen().

int vlc_mutex_trylock ( vlc_mutex_t p_mutex  ) 

Acquires a mutex if and only if it is not currently held by another thread.

This function never sleeps and can be used in delay-critical code paths. This function is not a cancellation-point.

Beware: If this function fails, then the mutex is held... by another thread. The calling thread must deal with the error appropriately. That typically implies postponing the operations that would have required the mutex. If the thread cannot defer those operations, then it must use vlc_mutex_lock(). If in doubt, use vlc_mutex_lock() instead.

Parameters:
p_mutex mutex initialized with vlc_mutex_init() or vlc_mutex_init_recursive()
Returns:
0 if the mutex could be acquired, an error code otherwise.

References vlc_mutex_init(), vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_THREAD_ASSERT.

Referenced by vout_snapshot_IsRequested().

void vlc_mutex_unlock ( vlc_mutex_t p_mutex  ) 

Releases a mutex (or crashes if the mutex is not locked by the caller).

Parameters:
p_mutex mutex locked with vlc_mutex_lock().

References VLC_THREAD_ASSERT.

Referenced by __config_GetPsz(), __config_LoadConfigFile(), __config_PutPsz(), __config_ResetAll(), __osd_ButtonFind(), __osd_ButtonSelect(), __osd_MenuActivate(), __osd_MenuCreate(), __osd_MenuDelete(), __osd_MenuDown(), __osd_MenuHide(), __osd_MenuNext(), __osd_MenuPrev(), __osd_MenuShow(), __osd_MenuUp(), __osd_Volume(), __stats_TimerClean(), __stats_TimerDump(), __stats_TimersCleanAll(), __stats_TimersDumpAll(), __stats_TimerStart(), __stats_TimerStop(), __str_format_meta(), __var_AddCallback(), __var_Change(), __var_Create(), __var_DelCallback(), __var_Destroy(), __var_GetAndSet(), __var_TriggerCallback(), __var_Type(), __vlc_event_attach(), __vlc_object_kill(), __vlm_New(), __vout_Create(), __vout_Request(), AcquireDrawable(), ActiveKeyCallback(), Add(), AddOut(), AddToQueue(), AdjustCallback(), AllCallback(), aout_new_buffer(), aout_Restart(), aout_unlock_input(), aout_unlock_input_fifos(), aout_unlock_mixer(), aout_unlock_output_fifo(), AReadBlock(), AReadStream(), Art(), ArtCachePath(), AssHandleHold(), AssHandleRelease(), Atmo_Shutdown(), AudioStreamChangeFormat(), BandsCallback(), Block(), block_FifoEmpty(), block_FifoGet(), block_FifoPace(), block_FifoPut(), block_FifoWake(), BlockDecode(), BluescreenCallback(), ButtonUpdate(), CacheChanged(), callback(), cb_delete(), cb_fetch(), cb_store(), ChangeKeyCallback(), Close(), Close_LuaIntf(), CloseDecoder(), CloseWindow(), CommandThread(), config_AutoSaveConfigFile(), Control(), ControlPop(), ControlReduce(), ControlReopenDevice(), VideoWindow::ControlWindow(), Create(), CreateFilter(), Decode(), DecodeBlock(), DecodePacket(), DecoderClose(), DecoderDecodeAudio(), DecoderDecodeVideo(), DecoderGetCc(), DecoderGetDisplayDate(), DecoderIsFlushing(), DecoderOpen(), DecoderPlayAudio(), DecoderPlaySout(), DecoderPlaySpu(), DecoderPlayVideo(), DecoderProcessOnFlush(), DecoderProcessSpu(), DecoderSignalBuffering(), DecoderThread(), DecoderWaitDate(), DecodeVideo(), DecOpen(), DecSysHold(), DecSysRelease(), Del(), DeleteDecoder(), CAtmoExternalCaptureInput::DeliverNewSourceDataPaket(), DelOut(), Demux(), DemuxFile(), DemuxOpen(), DesktopCallback(), DetachAout(), dialog_GetProvider(), dialog_Register(), dialog_Unregister(), DirectDrawUpdateOverlay(), DirectXEventProc(), DisplayVideo(), DoChildren(), DumpCommand(), End(), CapturePin::EndFlush(), EqzFilter(), EraseCallback(), EsOutAdd(), EsOutControl(), EsOutDel(), EsOutMeta(), EsOutProgramEpg(), EsOutSend(), event_attach(), demux_sys_t::EventKey(), EventKey(), demux_sys_t::EventMouse(), EventThread(), demux_sys_t::EventThread(), EventThreadGetAndResetHasMoved(), EventThreadRetreiveChanges(), EventThreadStart(), EventThreadStop(), EventThreadUpdateSourceAndPlace(), EventThreadUpdateTitle(), EventThreadUpdateWindowPosition(), EventThreadUseOverlay(), CAtmoLiveView::Execute(), CmdReleaseVoutWindow::execute(), CmdNewVoutWindow::execute(), ExtractCallback(), FakeCallback(), Fetch(), FfmpegExecute(), Filter(), FilterCallback(), FilterPacked(), FilterPlanar(), FilterSub(), FilterVideo(), AsyncQueue::flush(), FreePictureVec(), FullscreenControllerWidget::fullscreenChanged(), GatherPES(), GetInputMeta(), VideoWindow::GetWindow(), VoutManager::getWindow(), gnutls_Deinit(), gnutls_Init(), GradientCallback(), HoldAout(), HoldVout(), HoldVouts(), httpd_TLSHostNew(), Inhibit(), InitThread(), InitVideo(), input_clock_ChangePause(), input_clock_ChangeRate(), input_clock_ChangeSystemOrigin(), input_clock_ConvertTS(), input_clock_GetJitter(), input_clock_GetRate(), input_clock_GetState(), input_clock_GetWakeup(), input_clock_Reset(), input_clock_SetJitter(), input_clock_Update(), input_ControlPush(), input_DecoderChangeDelay(), input_DecoderChangePause(), input_DecoderDelete(), input_DecoderFrameNext(), input_DecoderGetCcState(), input_DecoderHasFormatChanged(), input_DecoderIsCcPresent(), input_DecoderSetCcState(), input_DecoderStartBuffering(), input_DecoderStopBuffering(), input_DecoderWaitBuffering(), input_ExtractAttachmentAndCacheArt(), input_item_AddInfo(), input_item_AddOption(), input_item_AddSubItem(), input_item_CopyOptions(), input_item_DelInfo(), input_item_GetDuration(), input_item_GetInfo(), input_item_GetMeta(), input_item_GetName(), input_item_GetTitleFbName(), input_item_GetURI(), input_item_HasErrorWhenReading(), input_item_IsArtFetched(), input_item_IsPreparsed(), input_item_MetaMatch(), input_item_NewWithType(), input_item_SetArtFetched(), input_item_SetArtNotFound(), input_item_SetDuration(), input_item_SetEpg(), input_item_SetEpgOffline(), input_item_SetErrorWhenReading(), input_item_SetMeta(), input_item_SetName(), input_item_SetPreparsed(), input_item_SetURI(), input_item_WriteMeta(), input_resource_Detach(), input_resource_HasVout(), input_resource_RequestAout(), input_resource_RequestSout(), input_resource_RequestVout(), input_resource_SetInput(), input_Stop(), input_UpdateStatistic(), input_vaControl(), InputSourceInit(), InputSourceMeta(), intf_Create(), intf_DestroyAll(), ItemChange(), KeepAliveThread(), KeyEvent(), KillerThread(), libvlc_event_async_dispatch(), libvlc_event_detach(), libvlc_event_manager_register_event_type(), libvlc_event_send(), libvlc_InternalCreate(), libvlc_InternalDestroy(), libvlc_InternalWait(), libvlc_media_list_media(), libvlc_media_list_release(), libvlc_media_list_retain(), libvlc_media_list_set_media(), libvlc_media_list_unlock(), libvlc_media_list_view_event_manager(), libvlc_media_list_view_parent_media_list(), libvlc_media_list_view_release(), libvlc_media_list_view_retain(), libvlc_Quit(), libvlc_release(), libvlc_retain(), libvlc_setup_threads(), libvlc_unlock(), LogoCallback(), main(), MainLoopInterface(), Manage(), MarqueeCallback(), MaskCallback(), media_player_reached_end(), MediaAddES(), MediaDel(), MediaDelES(), MediaNew(), mms_CommandSend(), module_EndBank(), module_LoadPlugins(), MosaicCallback(), Mouse(), MouseEvent(), msg_Create(), msg_Destroy(), mvar_InfoSetNew(), ItemInfoDialog::OnOk(), onSystrayChange(), onTaskBarChange(), OnTopCallback(), Opaque(), Open(), OpenAudio(), OpenDecoder(), OpenVideo(), OpenWindow(), ParseExecute(), picture_fifo_Flush(), picture_fifo_OffsetDate(), picture_fifo_Peek(), picture_fifo_Pop(), picture_fifo_Push(), playlist_fetcher_Delete(), playlist_fetcher_Push(), playlist_LiveSearchUpdateInternal(), playlist_preparser_Delete(), playlist_preparser_Push(), playlist_Unlock(), PlaylistNext(), Position(), PositionChanged(), PostprocPict(), PPChangeMode(), PreampCallback(), Preparse(), PresetCallback(), process_server_message(), MessagesView::Pulse(), AsyncQueue::push(), PushPicture(), PuzzleCallback(), queue_unlock(), RateChanged(), Raw1394Handler(), ReadCompressed(), ReadMetaData(), CapturePin::Receive(), Redraw(), ReleaseDrawable(), VideoWindow::ReleaseWindow(), VoutManager::releaseWindow(), Render(), RequestAout(), RequestPage(), RequestVout(), rtmp_connect_active(), rtmp_connect_passive(), rtmp_handler_invoke(), rtp_process(), rtp_thread(), RtspDelId(), RtspHandler(), Run(), RunIntf(), RunThread(), SaveConfigFile(), ScalingCallback(), SDLCallback(), SendIn(), SendOut(), FullscreenControllerWidget::setVoutList(), SharpenCallback(), sout_AnnounceRegisterSDP(), sout_AnnounceUnRegister(), sout_InputDelete(), sout_InputNew(), sout_InputSendBuffer(), spu_DisplaySubpicture(), spu_new_buffer(), spu_OffsetSubtitleDate(), spu_RenderSubpictures(), spu_SortSubpictures(), SpuClearChannel(), SpuControl(), StateCallback(), StateChanged(), Statistics(), stats_ComputeInputStats(), stats_DumpInputStats(), stats_ReinitInputStats(), StillTimer(), StreamListener(), SubFilterCallback(), SwitchDisplay(), CThread::Terminate(), Thread(), ThreadControl(), ThreadSend(), CThread::ThreadSleep(), transcode_video_close(), transcode_video_process(), TriggerCallback(), TSDate(), TwoPassCallback(), uninstall_media_player_observer(), unlock(), CAtmoDynData::UnLockCriticalSection(), InputStatsPanel::update(), ExtraMetaPanel::update(), UpdateBookmarksOption(), FileInfo::UpdateFileInfo(), ItemInfoDialog::UpdateInfo(), UpdateRegions(), UpdateSPU(), updateStatistics(), VLCInfo::updateStatistics:, UrlsChange(), var_GetChecked(), var_SetChecked(), video_del_buffer_filter(), video_widget_ready(), VideoFilter2Callback(), vlc_avcodec_mutex(), vlc_cleanup_lock(), vlc_event_detach(), vlc_event_manager_register_event_type(), vlc_event_send(), vlc_gcrypt_init(), vlc_mutex_lock(), vlc_mutex_trylock(), vlc_object_get_name(), vlc_object_set_name(), vlc_osso_unblank(), vlc_rwlock_rdlock(), vlc_rwlock_unlock(), vlc_rwlock_wrlock(), vlc_threads_setup(), vlc_timer_destroy(), vlc_timer_do(), vlc_timer_getoverrun(), vlc_timer_schedule(), vlc_timer_thread(), vlclua_lock_and_wait(), vlm_Control(), vlm_Delete(), vlm_ExecuteCommand(), vlm_MediaVodControl(), vnc_worker_thread(), VolumeChanged(), vout_AreDisplayPicturesInvalid(), vout_ChangePause(), vout_Close(), vout_CountPictureAvailable(), vout_CreatePicture(), vout_DestroyPicture(), vout_DisplayPicture(), vout_DisplayTitle(), vout_DropPicture(), vout_FixLeaks(), vout_Flush(), vout_LinkPicture(), vout_ManageDisplay(), vout_new_buffer(), vout_NextPicture(), vout_SetDisplayFullscreen(), vout_SetDisplayOnTop(), vout_snapshot_End(), vout_snapshot_Get(), vout_snapshot_IsRequested(), vout_snapshot_Set(), vout_UnlinkPicture(), VoutDisplayEvent(), VoutDisplayEventMouse(), WaitPreparsed(), and WindowOpen().

void vlc_restorecancel ( int  state  ) 

void vlc_rwlock_destroy ( vlc_rwlock_t  ) 

Destroys an initialized unused read/write lock.

References vlc_cond_destroy(), vlc_mutex_destroy(), and VLC_THREAD_ASSERT.

Referenced by msg_Destroy().

void vlc_rwlock_init ( vlc_rwlock_t  ) 

Initializes a read/write lock.

References vlc_cond_init(), and vlc_mutex_init().

Referenced by msg_Create().

void vlc_rwlock_rdlock ( vlc_rwlock_t lock  ) 

Acquires a read/write lock for reading.

Recursion is allowed.

References vlc_cond_wait(), vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_THREAD_ASSERT.

Referenced by QueueMsg().

void vlc_rwlock_unlock ( vlc_rwlock_t  ) 

void vlc_rwlock_wrlock ( vlc_rwlock_t lock  ) 

Acquires a read/write lock for writing.

Recursion is not allowed.

References vlc_cond_wait(), vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_THREAD_ASSERT.

Referenced by __msg_DisableObjectPrinting(), __msg_EnableObjectPrinting(), msg_Subscribe(), and msg_Unsubscribe().

int vlc_savecancel ( void   ) 

Save the current cancellation state (enabled or disabled), then disable cancellation for the calling thread.

This function must be called before entering a piece of code that is not cancellation-safe, unless it can be proven that the calling thread will not be cancelled.

Returns:
Previous cancellation state (opaque value for vlc_restorecancel()).

References cancel_key, vlc_cancel_t::killable, VLC_THREAD_ASSERT, and vlc_threadvar_get().

Referenced by __net_Read(), __vlc_custom_create(), __vlc_object_kill(), __vlc_object_release(), ALSAFill(), AppThread(), CommandThread(), DecoderThread(), DStreamThread(), EventThread(), demux_sys_t::EventThread(), KeepAliveThread(), MainLoop(), Manage(), MsgCallback(), MyThread(), OSSThread(), Overflow(), PrintMsg(), PrintObject(), QNXaoutThread(), QueueMsg(), rtp_recv(), rtp_thread(), Run(), RunIntf(), RunQtThread(), Thread(), ThreadControl(), ThreadSend(), TimeoutPrevention(), TsRun(), update_request_thread(), vlc_thread_fatal(), and vnc_worker_thread().

void vlc_sem_destroy ( vlc_sem_t  ) 

Destroys a semaphore.

References VLC_THREAD_ASSERT.

Referenced by Close(), Open(), and vlm_OnMediaUpdate().

void vlc_sem_init ( vlc_sem_t ,
unsigned   
)

Initializes a semaphore.

Referenced by Open(), and vlm_OnMediaUpdate().

int vlc_sem_post ( vlc_sem_t  ) 

Increments the value of a semaphore.

References VLC_THREAD_ASSERT.

Referenced by InputEventPreparse(), and Thread().

void vlc_sem_wait ( vlc_sem_t  ) 

Atomically wait for the semaphore to become non-zero (if needed), then decrements it.

References vlc_testcancel(), and VLC_THREAD_ASSERT.

Referenced by ALSAThread(), and vlm_OnMediaUpdate().

static void vlc_spin_init ( vlc_spinlock_t spin  )  [inline, static]

void vlc_testcancel ( void   ) 

Issues an explicit deferred cancellation point.

This has no effect if thread cancellation is disabled. This can be called when there is a rather slow non-sleeping operation. This is also used to force a cancellation point in a function that would otherwise "not always" be a one (block_FifoGet() is an example).

References cancel_key, vlc_cancel_t::cleaners, vlc_cancel_t::killable, vlc_cancel_t::killed, and vlc_threadvar_get().

Referenced by block_FifoGet(), block_FifoPace(), block_FifoShow(), mwait(), SigThread(), vlc_cond_timedwait(), vlc_cond_wait(), vlc_join(), vlc_poll(), and vlc_sem_wait().

int vlc_thread_create ( vlc_object_t ,
const char *  ,
int  ,
const char *  ,
void *  *)(vlc_object_t *,
int   
)

int vlc_threadvar_create ( vlc_threadvar_t key,
void(*)(void *)  destr 
)

Allocates a thread-specific variable.

Parameters:
key where to store the thread-specific variable handle
destr a destruction callback. It is called whenever a thread exits and the thread-specific variable has a non-NULL value.
Returns:
0 on success, a system error code otherwise. This function can actually fail because there is a fixed limit on the number of thread-specific variable in a process on most systems.

References VLC_UNUSED.

Referenced by DllMain(), libvlc_event_async_init(), libvlc_setup_threads(), and msg_Create().

void vlc_threadvar_delete ( vlc_threadvar_t  ) 

void* vlc_threadvar_get ( vlc_threadvar_t  key  ) 

Gets the value of a thread-local variable for the calling thread.

This function cannot fail.

Returns:
the value associated with the given variable for the calling or NULL if there is no value.

Referenced by current_thread_is_asynch_thread(), get_error(), GetContext(), vlc_control_cancel(), vlc_restorecancel(), vlc_savecancel(), and vlc_testcancel().

int vlc_threadvar_set ( vlc_threadvar_t  key,
void *  value 
)

Sets a thread-specific variable.

Parameters:
key thread-local variable key (created with vlc_threadvar_create())
value new value for the variable for the calling thread
Returns:
0 on success, a system error code otherwise.
Sets a thread-specific variable.

Parameters:
key thread-local variable key (created with vlc_threadvar_create())
value new value for the variable for the calling thread
Returns:
0 on success, a system error code otherwise.

Referenced by event_async_loop(), GetContext(), libvlc_clearerr(), libvlc_vprinterr(), and vlc_entry().

int vlc_timer_create ( vlc_timer_t id,
void(*)(void *)  func,
void *  data 
)

Initializes an asynchronous timer.

Warning:
Asynchronous timers are processed from an unspecified thread. Also, multiple occurences of an interval timer can run concurrently.
Parameters:
id pointer to timer to be initialized
func function that the timer will call
data parameter for the timer function
Returns:
0 on success, a system error code otherwise.

References vlc_timer::data, vlc_timer::func, vlc_timer::handle, vlc_timer::interval, INVALID_HANDLE_VALUE, vlc_timer::lock, vlc_timer::overruns, timer, vlc_timer::users, vlc_timer::value, vlc_cond_init(), vlc_mutex_init(), and vlc_timer::wait.

Referenced by Activate(), CreateFilter(), main(), Open(), and rtp_thread().

void vlc_timer_destroy ( vlc_timer_t  timer  ) 

Destroys an initialized timer.

If needed, the timer is first disarmed. This function is undefined if the specified timer is not initialized.

Warning:
This function must be called before the timer data can be freed and before the timer callback function can be unloaded.
Parameters:
timer timer to destroy

References vlc_timer::handle, INVALID_HANDLE_VALUE, vlc_timer::lock, vlc_timer::users, vlc_cond_destroy(), vlc_cond_wait(), vlc_mutex_destroy(), vlc_mutex_lock(), vlc_mutex_unlock(), vlc_timer_schedule(), and vlc_timer::wait.

Referenced by Close(), Deactivate(), DestroyFilter(), main(), and timer_cleanup().

unsigned vlc_timer_getoverrun ( vlc_timer_t  timer  ) 

Fetch and reset the overrun counter for a timer.

Parameters:
timer initialized timer
Returns:
the timer overrun counter, i.e. the number of times that the timer should have run but did not since the last actual run. If all is well, this is zero.

References vlc_timer::lock, vlc_timer::overruns, vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by callback(), and main().

void vlc_timer_schedule ( vlc_timer_t  timer,
bool  absolute,
mtime_t  value,
mtime_t  interval 
)

Arm or disarm an initialized timer.

This functions overrides any previous call to itself.

Note:
A timer can fire later than requested due to system scheduling limitations. An interval timer can fail to trigger sometimes, either because the system is busy or suspended, or because a previous iteration of the timer is still running. See also vlc_timer_getoverrun().
Parameters:
timer initialized timer
absolute the timer value origin is the same as mdate() if true, the timer value is relative to now if false.
value zero to disarm the timer, otherwise the initial time to wait before firing the timer.
interval zero to fire the timer just once, otherwise the timer repetition interval.

References __MAX, __MIN, vlc_timer::handle, vlc_timer::interval, INVALID_HANDLE_VALUE, vlc_timer::lock, lock, mdate(), vlc_timer::thread, vlc_timer::value, vlc_cancel(), vlc_clone(), vlc_join(), vlc_mutex_lock(), vlc_mutex_unlock(), VLC_STATIC_MUTEX, VLC_THREAD_PRIORITY_INPUT, vlc_timer_do(), and vlc_timer_thread().

Referenced by Control(), CreateFilter(), Demux(), Inhibit(), main(), Open(), rtp_process(), and vlc_timer_destroy().


Generated on Sat Nov 21 08:05:27 2009 for VLC by  doxygen 1.5.6