[vlc-commits] core: set names to threads created in the core
Steve Lhomme
git at videolan.org
Fri Nov 13 16:52:40 CET 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Nov 9 15:07:59 2020 +0100| [2415cec16af31f63d0bd589a1022f21b4875ddd6] | committer: Steve Lhomme
core: set names to threads created in the core
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2415cec16af31f63d0bd589a1022f21b4875ddd6
---
src/input/decoder.c | 2 ++
src/input/demux_chained.c | 2 ++
src/input/es_out_timeshift.c | 2 ++
src/input/input.c | 4 ++++
src/input/vlm.c | 4 +++-
src/misc/addons.c | 4 ++++
src/misc/executor.c | 4 ++++
src/misc/update.c | 4 ++++
src/network/httpd.c | 2 ++
src/player/player.c | 2 ++
src/posix/getaddrinfo.c | 2 ++
src/posix/timer.c | 2 ++
src/stream_output/sap.c | 2 ++
src/video_output/video_output.c | 2 ++
src/video_output/vout_subpictures.c | 2 ++
src/win32/mta_holder.h | 2 ++
16 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 793c7e687f..a509d885ae 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1584,6 +1584,8 @@ static void *DecoderThread( void *p_data )
vlc_tick_t delay = 0;
bool paused = false;
+ vlc_thread_set_name("vlc-decoder");
+
/* The decoder's main loop */
vlc_fifo_Lock( p_owner->p_fifo );
diff --git a/src/input/demux_chained.c b/src/input/demux_chained.c
index c8c436daec..4b5bae72ae 100644
--- a/src/input/demux_chained.c
+++ b/src/input/demux_chained.c
@@ -53,6 +53,8 @@ struct vlc_demux_chained_t
static void *vlc_demux_chained_Thread(void *data)
{
+ vlc_thread_set_name("vlc-demux-chain");
+
vlc_demux_chained_t *dc = data;
demux_t *demux = demux_New(VLC_OBJECT(dc->reader), dc->name, dc->reader,
dc->out);
diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
index 3239e8e9c2..eb82f07648 100644
--- a/src/input/es_out_timeshift.c
+++ b/src/input/es_out_timeshift.c
@@ -1089,6 +1089,8 @@ static int TsChangeRate( ts_thread_t *p_ts, float src_rate, float rate )
static void *TsRun( void *p_data )
{
+ vlc_thread_set_name("vlc-timeshift");
+
ts_thread_t *p_ts = p_data;
vlc_tick_t i_buffering_date = -1;
diff --git a/src/input/input.c b/src/input/input.c
index 4be4d304f6..9a053386c2 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -464,6 +464,8 @@ static void *Run( void *data )
input_thread_private_t *priv = data;
input_thread_t *p_input = &priv->input;
+ vlc_thread_set_name("vlc-input");
+
vlc_interrupt_set(&priv->interrupt);
if( !Init( p_input ) )
@@ -490,6 +492,8 @@ static void *Preparse( void *data )
input_thread_private_t *priv = data;
input_thread_t *p_input = &priv->input;
+ vlc_thread_set_name("vlc-preparse");
+
vlc_interrupt_set(&priv->interrupt);
if( !Init( p_input ) )
diff --git a/src/input/vlm.c b/src/input/vlm.c
index 116fc5296e..cc4be6110a 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -239,6 +239,8 @@ int vlm_ExecuteCommand( vlm_t *p_vlm, const char *psz_command,
*****************************************************************************/
static void* Manage( void* p_object )
{
+ vlc_thread_set_name("vlc-vlm");
+
vlm_t *vlm = (vlm_t*)p_object;
time_t lastcheck;
bool exiting;
@@ -774,7 +776,7 @@ static int vlm_ControlMediaInstanceGetTimePosition( vlm_t *p_vlm, int64_t id, co
vlc_player_Lock(p_instance->player);
if( pi_time )
- *pi_time = US_FROM_VLC_TICK(vlc_player_GetTime(p_instance->player));
+ *pi_time = US_FROM_VLC_TICK(vlc_player_GetTime(p_instance->player));
if( pd_position )
*pd_position = vlc_player_GetPosition(p_instance->player);
vlc_player_Unlock(p_instance->player);
diff --git a/src/misc/addons.c b/src/misc/addons.c
index 49a0f32463..bc784b7913 100644
--- a/src/misc/addons.c
+++ b/src/misc/addons.c
@@ -330,6 +330,8 @@ static void finder_thread_interrupted( void* p_data )
static void *FinderThread( void *p_data )
{
+ vlc_thread_set_name("vlc-addon-find");
+
addons_manager_t *p_manager = p_data;
int i_cancel = vlc_savecancel();
vlc_interrupt_set( p_manager->p_priv->finder.p_interrupt );
@@ -456,6 +458,8 @@ static void installer_thread_interrupted( void* p_data )
static void *InstallerThread( void *p_data )
{
+ vlc_thread_set_name("vlc-addon-instl");
+
addons_manager_t *p_manager = p_data;
int i_cancel = vlc_savecancel();
vlc_interrupt_set( p_manager->p_priv->installer.p_interrupt );
diff --git a/src/misc/executor.c b/src/misc/executor.c
index 3b79f9ba8d..6062dd3719 100644
--- a/src/misc/executor.c
+++ b/src/misc/executor.c
@@ -119,6 +119,8 @@ ThreadRun(void *userdata)
struct vlc_executor_thread *thread = userdata;
vlc_executor_t *executor = thread->owner;
+ vlc_thread_set_name("vlc-exec-runner");
+
vlc_mutex_lock(&executor->lock);
struct vlc_runnable *runnable;
@@ -126,6 +128,8 @@ ThreadRun(void *userdata)
while ((runnable = QueueTake(executor)))
{
thread->current_task = runnable;
+ vlc_thread_set_name("vlc-exec-runner");
+
vlc_mutex_unlock(&executor->lock);
/* Execute the user-provided runnable, without the executor lock */
diff --git a/src/misc/update.c b/src/misc/update.c
index a4c9349153..434bf8010a 100644
--- a/src/misc/update.c
+++ b/src/misc/update.c
@@ -412,6 +412,8 @@ void update_Check( update_t *p_update, void (*pf_callback)( void*, bool ), void
void* update_CheckReal( void *obj )
{
+ vlc_thread_set_name("vlc-updater-chk");
+
update_check_thread_t *p_uct = (update_check_thread_t *)obj;
bool b_ret;
int canc;
@@ -524,6 +526,8 @@ void update_Download( update_t *p_update, const char *psz_destdir )
static void* update_DownloadReal( void *obj )
{
+ vlc_thread_set_name("vlc-updater-dl");
+
update_download_thread_t *p_udt = (update_download_thread_t *)obj;
uint64_t l_size;
uint64_t l_downloaded = 0;
diff --git a/src/network/httpd.c b/src/network/httpd.c
index 52c8e5bdf3..0026a609ed 100644
--- a/src/network/httpd.c
+++ b/src/network/httpd.c
@@ -2057,6 +2057,8 @@ static void httpdLoop(httpd_host_t *host)
static void* httpd_HostThread(void *data)
{
+ vlc_thread_set_name("vlc-httpd");
+
httpd_host_t *host = data;
while (atomic_load_explicit(&host->ref, memory_order_relaxed) > 0)
diff --git a/src/player/player.c b/src/player/player.c
index c4ba5b120d..3c9eef2136 100644
--- a/src/player/player.c
+++ b/src/player/player.c
@@ -200,6 +200,8 @@ vlc_player_destructor_Thread(void *data)
{
vlc_player_t *player = data;
+ vlc_thread_set_name("vlc-player-end");
+
vlc_mutex_lock(&player->lock);
/* Terminate this thread when the player is deleting (vlc_player_Delete()
diff --git a/src/posix/getaddrinfo.c b/src/posix/getaddrinfo.c
index c7f9bf07b5..eae812b757 100644
--- a/src/posix/getaddrinfo.c
+++ b/src/posix/getaddrinfo.c
@@ -42,6 +42,8 @@ struct vlc_gai_req
static void *vlc_gai_thread(void *data)
{
+ vlc_thread_set_name("vlc-getaddrinfo");
+
struct vlc_gai_req *req = data;
req->error = EAI_SYSTEM;
diff --git a/src/posix/timer.c b/src/posix/timer.c
index d88df7d501..7e63246a09 100644
--- a/src/posix/timer.c
+++ b/src/posix/timer.c
@@ -52,6 +52,8 @@ struct vlc_timer
static void *vlc_timer_thread (void *data)
{
+ vlc_thread_set_name("vlc-timer");
+
struct vlc_timer *timer = data;
vlc_mutex_lock (&timer->lock);
diff --git a/src/stream_output/sap.c b/src/stream_output/sap.c
index 0e699faeee..b72db10863 100644
--- a/src/stream_output/sap.c
+++ b/src/stream_output/sap.c
@@ -119,6 +119,8 @@ static void AddressDestroy (sap_address_t *addr)
*/
static void *RunThread (void *self)
{
+ vlc_thread_set_name("vlc-sap");
+
sap_address_t *addr = self;
vlc_mutex_lock(&sap_mutex);
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 57ee54e6e8..e43d537781 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1887,6 +1887,8 @@ static void *Thread(void *object)
vout_thread_sys_t *vout = object;
vout_thread_sys_t *sys = vout;
+ vlc_thread_set_name("vlc-vout");
+
vlc_tick_t deadline = VLC_TICK_INVALID;
bool wait = false;
diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index f60c6f5797..63b832a287 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -1522,6 +1522,8 @@ static void * spu_PrerenderThread(void *priv)
spu_private_t *sys = spu->p;
vlc_fourcc_t chroma_list[SPU_CHROMALIST_COUNT+1];
+ vlc_thread_set_name("vlc-spu-prerend");
+
chroma_list[SPU_CHROMALIST_COUNT] = 0;
vlc_mutex_lock(&sys->prerender.lock);
diff --git a/src/win32/mta_holder.h b/src/win32/mta_holder.h
index dff4bfdfca..c0f6ddab0e 100644
--- a/src/win32/mta_holder.h
+++ b/src/win32/mta_holder.h
@@ -39,6 +39,8 @@ typedef struct vlc_mta_holder
static inline void* MtaMainLoop( void* opaque )
{
+ vlc_thread_set_name("vlc-mta");
+
vlc_mta_holder* p_mta = (vlc_mta_holder*)opaque;
CoInitializeEx( NULL, COINIT_MULTITHREADED );
More information about the vlc-commits
mailing list