VLC  2.1.0-git
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
thread.c File Reference
Include dependency graph for thread.c:

Data Structures

struct  vlc_thread
 Per-thread data. More...

Macros

#define vlc_assert(x)
#define VLC_THREAD_ASSERT(action)

Functions

static struct timespec mtime_to_ts (mtime_t date)
static void vlc_thread_fatal (const char *action, int error, const char *function, const char *file, unsigned line)
void vlc_mutex_init (vlc_mutex_t *p_mutex)
void vlc_mutex_init_recursive (vlc_mutex_t *p_mutex)
void vlc_mutex_destroy (vlc_mutex_t *p_mutex)
void vlc_assert_locked (vlc_mutex_t *p_mutex)
void vlc_mutex_lock (vlc_mutex_t *p_mutex)
int vlc_mutex_trylock (vlc_mutex_t *p_mutex)
void vlc_mutex_unlock (vlc_mutex_t *p_mutex)
void vlc_threads_setup (libvlc_int_t *p_libvlc)
void vlc_cond_init (vlc_cond_t *condvar)
void vlc_cond_init_daytime (vlc_cond_t *condvar)
void vlc_cond_destroy (vlc_cond_t *condvar)
void vlc_cond_signal (vlc_cond_t *condvar)
void vlc_cond_broadcast (vlc_cond_t *condvar)
void vlc_cond_wait (vlc_cond_t *condvar, vlc_mutex_t *p_mutex)
int vlc_cond_timedwait (vlc_cond_t *condvar, vlc_mutex_t *p_mutex, mtime_t deadline)
static void clean_detached_thread (void *data)
static void * detached_thread (void *data)
static void finish_joinable_thread (void *data)
static void * joinable_thread (void *data)
static int vlc_clone_attr (vlc_thread_t *th, void *(*entry)(void *), void *data, bool detach)
int vlc_clone (vlc_thread_t *th, void *(*entry)(void *), void *data, int priority)
void vlc_join (vlc_thread_t handle, void **result)
int vlc_clone_detach (vlc_thread_t *th, void *(*entry)(void *), void *data, int priority)
int vlc_set_priority (vlc_thread_t th, int priority)
void vlc_cancel (vlc_thread_t thread_id)
int vlc_savecancel (void)
void vlc_restorecancel (int state)
void vlc_testcancel (void)
int vlc_threadvar_create (vlc_threadvar_t *key, void(*destr)(void *))
void vlc_threadvar_delete (vlc_threadvar_t *p_tls)
int vlc_threadvar_set (vlc_threadvar_t key, void *value)
void * vlc_threadvar_get (vlc_threadvar_t key)
mtime_t mdate (void)
void mwait ((mtime_t deadline))
void msleep ((mtime_t delay))
unsigned vlc_GetCPUCount (void)

Variables

static __thread struct vlc_threadthread = NULL

Macro Definition Documentation

#define vlc_assert (   x)
Value:
do { \
if (unlikely(!x)) { \
__android_log_print(ANDROID_LOG_ERROR, "vlc", "assert failed %s:%d: %s", \
__FILE__, __LINE__, #x \
); \
abort(); \
} \
} while(0)

Referenced by vlc_assert_locked().

#define VLC_THREAD_ASSERT (   action)
Value:
if (unlikely(val)) \
vlc_thread_fatal (action, val, __func__, __FILE__, __LINE__)

Referenced by vlc_cond_destroy(), vlc_cond_signal(), vlc_cond_timedwait(), vlc_cond_wait(), vlc_join(), vlc_mutex_destroy(), vlc_mutex_lock(), vlc_mutex_trylock(), and vlc_mutex_unlock().

Function Documentation

static void clean_detached_thread ( void *  data)
static
static void* detached_thread ( void *  data)
static
static void finish_joinable_thread ( void *  data)
static

References vlc_thread::data, and vlc_sem_post().

Referenced by joinable_thread().

static void* joinable_thread ( void *  data)
static
mtime_t mdate ( void  )
void msleep ( (mtime_t delay)  )
static struct timespec mtime_to_ts ( mtime_t  date)
staticread

References CLOCK_FREQ, and lldiv().

Referenced by vlc_cond_timedwait().

void mwait ( (mtime_t deadline)  )
void vlc_assert_locked ( vlc_mutex_t p_mutex)

References vlc_assert.

void vlc_cancel ( vlc_thread_t  thread_id)
int vlc_clone ( vlc_thread_t th,
void *(*)(void *)  entry,
void *  data,
int  priority 
)
static int vlc_clone_attr ( vlc_thread_t th,
void *(*)(void *)  entry,
void *  data,
bool  detach 
)
static
int vlc_clone_detach ( vlc_thread_t th,
void *(*)(void *)  entry,
void *  data,
int  priority 
)
void vlc_cond_broadcast ( vlc_cond_t condvar)
void vlc_cond_destroy ( vlc_cond_t condvar)
void vlc_cond_init ( vlc_cond_t condvar)
void vlc_cond_init_daytime ( vlc_cond_t condvar)

Referenced by vlm_New().

void vlc_cond_signal ( vlc_cond_t condvar)
int vlc_cond_timedwait ( vlc_cond_t condvar,
vlc_mutex_t p_mutex,
mtime_t  deadline 
)
void vlc_cond_wait ( vlc_cond_t condvar,
vlc_mutex_t p_mutex 
)
unsigned vlc_GetCPUCount ( void  )
void vlc_join ( vlc_thread_t  handle,
void **  result 
)
void vlc_mutex_destroy ( vlc_mutex_t p_mutex)
void vlc_mutex_init ( vlc_mutex_t p_mutex)
void vlc_mutex_init_recursive ( vlc_mutex_t p_mutex)
void vlc_mutex_lock ( vlc_mutex_t p_mutex)

Referenced by Add(), aout_DeviceSet(), aout_MuteSet(), aout_new_buffer(), aout_OutputLock(), aout_OutputUnlock(), aout_VolumeSet(), AReadBlock(), AReadStream(), Art(), ArtCachePath(), block_FifoEmpty(), block_FifoGet(), block_FifoPace(), block_FifoPut(), block_FifoShow(), block_FifoWake(), callback(), ChangeToNode(), config_SaveConfigFile(), Control(), ControlPop(), Create(), DecoderDecodeAudio(), DecoderDecodeVideo(), DecoderGetCc(), DecoderGetDisplayDate(), DecoderIsExitRequested(), DecoderIsFlushing(), DecoderPlayAudio(), DecoderPlaySpu(), DecoderPlayVideo(), DecoderProcessOnFlush(), DecoderProcessSpu(), DecoderSignalBuffering(), Del(), DeleteDecoder(), dialog_GetProvider(), dialog_Register(), dialog_Unregister(), DStreamThread(), DumpCommand(), End(), EsOutAdd(), EsOutControl(), EsOutDel(), EsOutMeta(), EsOutProgramEpg(), EsOutSend(), HoldVout(), HoldVouts(), httpd_HostCreate(), httpd_HostDelete(), httpd_HostThread(), httpd_StreamCallBack(), httpd_StreamHeader(), httpd_StreamSend(), httpd_UrlCatch(), httpd_UrlDelete(), httpd_UrlNew(), InitTitle(), input_clock_ChangePause(), input_clock_ChangeRate(), input_clock_ChangeSystemOrigin(), input_clock_ConvertTS(), input_clock_GetJitter(), input_clock_GetRate(), input_clock_GetState(), input_clock_GetSystemOrigin(), 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_DecoderGetObjects(), input_DecoderHasFormatChanged(), input_DecoderIsCcPresent(), input_DecoderIsEmpty(), input_DecoderSetCcState(), input_DecoderStartBuffering(), input_DecoderStopBuffering(), input_DecoderWaitBuffering(), input_ExtractAttachmentAndCacheArt(), input_item_AddInfo(), input_item_AddOption(), input_item_Copy(), 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_MergeInfos(), input_item_MetaMatch(), input_item_ReplaceInfos(), 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_UpdateTracksInfo(), input_item_WriteMeta(), input_resource_GetAout(), input_resource_HasVout(), input_resource_HoldAout(), input_resource_PutAout(), input_resource_RequestSout(), input_resource_RequestVout(), input_resource_SetInput(), input_resource_TerminateAout(), input_Stop(), input_UpdateStatistic(), input_vaControl(), InputEvent(), InputSourceInit(), InputSourceMeta(), intf_Create(), intf_DestroyAll(), libvlc_lock(), libvlc_Quit(), libvlc_SetExitHandler(), LoadSubtitles(), main(), MainLoopInterface(), Manage(), module_EndBank(), module_InitBank(), mwait(), picture_fifo_Flush(), picture_fifo_OffsetDate(), picture_fifo_Peek(), picture_fifo_Pop(), picture_fifo_Push(), pl_Get(), playlist_fetcher_Delete(), playlist_fetcher_Push(), playlist_LiveSearchUpdateInternal(), playlist_Lock(), playlist_preparser_Delete(), playlist_preparser_Push(), Preparse(), PrintObject(), RequestVout(), Run(), RunThread(), SAP_Add(), SAP_Del(), Send(), sout_AnnounceRegisterSDP(), sout_AnnounceUnRegister(), sout_InputDelete(), sout_InputNew(), sout_InputSendBuffer(), spu_Attach(), spu_ChangeFilters(), spu_ChangeMargin(), spu_ChangeSources(), spu_ClearChannel(), spu_new_buffer(), spu_OffsetSubtitleDate(), spu_ProcessMouse(), spu_PutSubpicture(), spu_RegisterChannel(), spu_Render(), stats_ComputeInputStats(), stats_ReinitInputStats(), str_format_meta(), stream_DemuxControlVa(), Thread(), ThreadChangeFilters(), ThreadDisplayPreparePicture(), ThreadDisplayRenderPicture(), ThreadFilterFlush(), ThreadManage(), TriggerCallback(), TsChangePause(), TsChangeRate(), TsHasCmd(), TsIsUnused(), TsPushCmd(), TsRun(), TsStop(), UpdateBookmarksOption(), UpdateSPU(), var_AddCallback(), var_Change(), var_Create(), var_DelCallback(), var_Destroy(), var_GetAndSet(), var_GetChecked(), var_SetChecked(), var_TriggerCallback(), var_Type(), vlc_cancel(), vlc_cond_timedwait(), vlc_cond_wait(), vlc_drand48(), vlc_event_attach(), vlc_event_detach(), vlc_event_manager_register_event_type(), vlc_event_send(), vlc_global_mutex(), vlc_lrand48(), vlc_mrand48(), vlc_mutex_lock(), vlc_mutex_trylock(), vlc_mutex_unlock(), vlc_object_find_name(), vlc_object_get_name(), vlc_object_kill(), vlc_object_set_name(), vlc_object_waitpipe(), vlc_thread_cleanup(), vlc_threads_setup(), vlc_threadvar_create(), vlc_threadvar_delete(), vlc_timer_schedule(), vlc_timer_thread(), vlm_Control(), vlm_Delete(), vlm_ExecuteCommand(), vlm_MediaVodControl(), vlm_New(), vout_AreDisplayPicturesInvalid(), vout_Close(), vout_control_Dead(), vout_control_Pop(), vout_control_Push(), vout_control_WaitEmpty(), vout_control_Wake(), vout_FixLeaks(), vout_GetPicture(), vout_HoldPicture(), vout_IsEmpty(), vout_ManageDisplay(), vout_new_buffer(), vout_OSDEpg(), vout_PutPicture(), vout_RegisterSubpictureChannel(), vout_ReleasePicture(), vout_SendDisplayEventMouse(), vout_SetDisplayFullscreen(), vout_SetWindowState(), vout_snapshot_End(), vout_snapshot_Get(), vout_snapshot_Set(), VoutDisplayEvent(), VoutDisplayEventMouse(), and VoutDisplayFitWindow().

int vlc_mutex_trylock ( vlc_mutex_t p_mutex)
void vlc_mutex_unlock ( vlc_mutex_t p_mutex)

Referenced by Add(), aout_DeviceSet(), aout_MuteSet(), aout_new_buffer(), aout_OutputUnlock(), aout_VolumeSet(), AReadBlock(), AReadStream(), Art(), ArtCachePath(), block_FifoEmpty(), block_FifoGet(), block_FifoPace(), block_FifoPut(), block_FifoWake(), callback(), ChangeToNode(), config_SaveConfigFile(), Control(), ControlPop(), Create(), DecoderDecodeAudio(), DecoderDecodeVideo(), DecoderGetCc(), DecoderGetDisplayDate(), DecoderIsExitRequested(), DecoderIsFlushing(), DecoderPlayAudio(), DecoderPlaySpu(), DecoderPlayVideo(), DecoderProcessOnFlush(), DecoderProcessSpu(), DecoderSignalBuffering(), Del(), DeleteDecoder(), dialog_GetProvider(), dialog_Register(), dialog_Unregister(), DStreamThread(), DumpCommand(), End(), EsOutAdd(), EsOutControl(), EsOutDel(), EsOutMeta(), EsOutProgramEpg(), EsOutSend(), HoldVout(), HoldVouts(), httpd_HostCreate(), httpd_HostDelete(), httpd_HostThread(), httpd_StreamCallBack(), httpd_StreamHeader(), httpd_StreamSend(), httpd_UrlCatch(), httpd_UrlDelete(), httpd_UrlNew(), InitTitle(), input_clock_ChangePause(), input_clock_ChangeRate(), input_clock_ChangeSystemOrigin(), input_clock_ConvertTS(), input_clock_GetJitter(), input_clock_GetRate(), input_clock_GetState(), input_clock_GetSystemOrigin(), 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_DecoderGetObjects(), input_DecoderHasFormatChanged(), input_DecoderIsCcPresent(), input_DecoderIsEmpty(), input_DecoderSetCcState(), input_DecoderStartBuffering(), input_DecoderStopBuffering(), input_DecoderWaitBuffering(), input_ExtractAttachmentAndCacheArt(), input_item_AddInfo(), input_item_AddOption(), input_item_Copy(), 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_MergeInfos(), input_item_MetaMatch(), input_item_ReplaceInfos(), 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_UpdateTracksInfo(), input_item_WriteMeta(), input_resource_GetAout(), input_resource_HasVout(), input_resource_HoldAout(), input_resource_PutAout(), input_resource_RequestSout(), input_resource_RequestVout(), input_resource_SetInput(), input_resource_TerminateAout(), input_Stop(), input_UpdateStatistic(), input_vaControl(), InputEvent(), InputSourceInit(), InputSourceMeta(), intf_Create(), intf_DestroyAll(), libvlc_Quit(), libvlc_SetExitHandler(), libvlc_unlock(), LoadSubtitles(), main(), MainLoopInterface(), Manage(), module_EndBank(), module_LoadPlugins(), picture_fifo_Flush(), picture_fifo_OffsetDate(), picture_fifo_Peek(), picture_fifo_Pop(), picture_fifo_Push(), pl_Get(), playlist_fetcher_Delete(), playlist_fetcher_Push(), playlist_LiveSearchUpdateInternal(), playlist_preparser_Delete(), playlist_preparser_Push(), playlist_Unlock(), Preparse(), PrintObject(), RequestVout(), Run(), SAP_Add(), SAP_Del(), Send(), sout_AnnounceRegisterSDP(), sout_AnnounceUnRegister(), sout_InputDelete(), sout_InputNew(), sout_InputSendBuffer(), spu_Attach(), spu_ChangeFilters(), spu_ChangeMargin(), spu_ChangeSources(), spu_ClearChannel(), spu_new_buffer(), spu_OffsetSubtitleDate(), spu_ProcessMouse(), spu_PutSubpicture(), spu_RegisterChannel(), spu_Render(), stats_ComputeInputStats(), stats_ReinitInputStats(), str_format_meta(), stream_DemuxControlVa(), Thread(), ThreadChangeFilters(), ThreadDisplayPreparePicture(), ThreadDisplayRenderPicture(), ThreadFilterFlush(), ThreadManage(), TriggerCallback(), TsChangePause(), TsChangeRate(), TsHasCmd(), TsIsUnused(), TsPushCmd(), TsStop(), UpdateBookmarksOption(), UpdateSPU(), var_AddCallback(), var_Change(), var_Create(), var_DelCallback(), var_Destroy(), var_GetAndSet(), var_GetChecked(), var_SetChecked(), var_TriggerCallback(), var_Type(), vlc_cancel(), vlc_cleanup_lock(), vlc_cond_timedwait(), vlc_cond_wait(), vlc_drand48(), vlc_event_attach(), vlc_event_detach(), vlc_event_manager_register_event_type(), vlc_event_send(), vlc_global_mutex(), vlc_lrand48(), vlc_mrand48(), vlc_mutex_lock(), vlc_mutex_trylock(), vlc_mutex_unlock(), vlc_object_find_name(), vlc_object_get_name(), vlc_object_kill(), vlc_object_set_name(), vlc_thread_cleanup(), vlc_threads_setup(), vlc_threadvar_create(), vlc_threadvar_delete(), vlc_timer_schedule(), vlc_timer_thread(), vlm_Control(), vlm_Delete(), vlm_ExecuteCommand(), vlm_MediaVodControl(), vlm_New(), vout_AreDisplayPicturesInvalid(), vout_Close(), vout_control_Dead(), vout_control_Pop(), vout_control_Push(), vout_control_WaitEmpty(), vout_control_Wake(), vout_FixLeaks(), vout_GetPicture(), vout_HoldPicture(), vout_IsEmpty(), vout_ManageDisplay(), vout_new_buffer(), vout_OSDEpg(), vout_PutPicture(), vout_RegisterSubpictureChannel(), vout_ReleasePicture(), vout_SendDisplayEventMouse(), vout_SetDisplayFullscreen(), vout_SetWindowState(), vout_snapshot_End(), vout_snapshot_Get(), vout_snapshot_IsRequested(), vout_snapshot_Set(), VoutDisplayEvent(), VoutDisplayEventMouse(), and VoutDisplayFitWindow().

void vlc_restorecancel ( int  state)
int vlc_savecancel ( void  )
int vlc_set_priority ( vlc_thread_t  th,
int  priority 
)

< No error

Referenced by Init().

void vlc_testcancel ( void  )
static void vlc_thread_fatal ( const char *  action,
int  error,
const char *  function,
const char *  file,
unsigned  line 
)
static

References msg.

void vlc_threads_setup ( libvlc_int_t p_libvlc)

Referenced by libvlc_InternalInit().

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

Referenced by _DLL_InitTerm(), and DllMain().

void vlc_threadvar_delete ( vlc_threadvar_t p_tls)

Referenced by _DLL_InitTerm(), and DllMain().

void* vlc_threadvar_get ( vlc_threadvar_t  key)
int vlc_threadvar_set ( vlc_threadvar_t  key,
void *  value 
)

Referenced by vlc_entry(), and vlc_thread_cleanup().

Variable Documentation

__thread struct vlc_thread* thread = NULL
static