[vlc-commits] modules: set names to threads created in modules

Steve Lhomme git at videolan.org
Fri Nov 13 16:52:41 CET 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Nov  9 15:08:23 2020 +0100| [d6f0a4215a5441290873a44309a504dfc5879d49] | committer: Steve Lhomme

modules: set names to threads created in modules

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d6f0a4215a5441290873a44309a504dfc5879d49
---

 modules/access/alsa.c                             |  2 ++
 modules/access/dv.c                               |  3 +++
 modules/access/http/h2conn.c                      |  2 ++
 modules/access/http/h2output.c                    | 13 +++++++++++--
 modules/access/mms/mmstu.c                        |  2 ++
 modules/access/rdp.c                              |  3 +++
 modules/access/rist.c                             |  2 ++
 modules/access/rtp/input.c                        |  2 ++
 modules/access/satip.c                            |  3 +++
 modules/access/screen/wayland.c                   |  3 +++
 modules/access/v4l2/demux.c                       |  6 ++++++
 modules/access/vnc.c                              |  2 ++
 modules/access_output/rist.c                      |  4 ++++
 modules/access_output/udp.c                       |  3 +++
 modules/audio_output/audiotrack.c                 |  3 +++
 modules/audio_output/directsound.c                |  2 ++
 modules/audio_output/mmdevice.c                   |  2 ++
 modules/codec/dmo/dmo.c                           |  2 ++
 modules/codec/omxil/mediacodec.c                  |  2 ++
 modules/control/cli/cli.c                         |  2 ++
 modules/control/dbus/dbus.c                       |  2 ++
 modules/control/globalhotkeys/win32.c             |  2 ++
 modules/control/globalhotkeys/xcb.c               |  2 ++
 modules/control/lirc.c                            |  2 ++
 modules/control/netsync.c                         |  5 +++++
 modules/control/ntservice.c                       |  2 ++
 modules/control/win_msg.c                         |  2 ++
 modules/demux/adaptive/PlaylistManager.cpp        |  2 ++
 modules/demux/adaptive/http/Downloader.cpp        |  2 ++
 modules/demux/mkv/events.cpp                      |  2 ++
 modules/gui/ncurses.c                             |  2 ++
 modules/gui/qt/qt.cpp                             |  2 ++
 modules/gui/skins2/src/skin_main.cpp              |  2 ++
 modules/lua/extension_thread.c                    |  2 ++
 modules/lua/intf.c                                |  2 ++
 modules/lua/services_discovery.c                  |  2 ++
 modules/misc/audioscrobbler.c                     |  2 ++
 modules/misc/fingerprinter.c                      |  2 ++
 modules/services_discovery/microdns.c             |  4 ++++
 modules/services_discovery/mtp.c                  |  2 ++
 modules/services_discovery/podcast.c              |  2 ++
 modules/services_discovery/sap.c                  |  3 +++
 modules/services_discovery/udev.c                 |  2 ++
 modules/services_discovery/upnp.cpp               |  4 ++++
 modules/services_discovery/xcb_apps.c             |  4 +++-
 modules/stream_filter/decomp.c                    |  2 ++
 modules/stream_filter/hds/hds.c                   |  4 ++++
 modules/stream_filter/prefetch.c                  |  2 ++
 modules/stream_out/chromecast/chromecast_ctrl.cpp |  2 ++
 modules/stream_out/rtp.c                          |  4 ++++
 modules/stream_out/sdi/DBMSDIOutput.cpp           |  2 ++
 modules/stream_out/sdi/SDIStream.cpp              |  2 ++
 modules/stream_out/transcode/encoder/video.c      |  3 +++
 modules/video_output/caca.c                       |  2 ++
 modules/video_output/wayland/xdg-shell.c          |  2 ++
 modules/video_output/win32/events.c               |  3 +++
 modules/video_output/win32/inhibit.c              |  2 ++
 modules/video_output/win32/window.c               |  2 ++
 modules/video_output/xcb/window.c                 |  2 ++
 modules/visualization/glspectrum.c                |  2 ++
 modules/visualization/goom.c                      |  2 ++
 modules/visualization/projectm.cpp                |  2 ++
 modules/visualization/visual/visual.c             |  2 ++
 modules/visualization/vsxu.cpp                    |  2 ++
 64 files changed, 164 insertions(+), 3 deletions(-)

diff --git a/modules/access/alsa.c b/modules/access/alsa.c
index a92cf3e2c0..4b2b716208 100644
--- a/modules/access/alsa.c
+++ b/modules/access/alsa.c
@@ -159,6 +159,8 @@ static void *Thread (void *data)
     size_t bytes;
     int canc, val;
 
+    vlc_thread_set_name("vlc-access-alsa");
+
     canc = vlc_savecancel ();
     bytes = snd_pcm_frames_to_bytes (pcm, sys->period_size);
     val = snd_pcm_start (pcm);
diff --git a/modules/access/dv.c b/modules/access/dv.c
index 8a8baa104d..fb8bf5f5a6 100644
--- a/modules/access/dv.c
+++ b/modules/access/dv.c
@@ -322,6 +322,9 @@ static void* Raw1394EventThread( void *obj )
     event_thread_t *p_ev = (event_thread_t *)obj;
     stream_t *p_access = (stream_t *) p_ev->p_access;
     access_sys_t *p_sys = (access_sys_t *) p_access->p_sys;
+
+    vlc_thread_set_name("vlc-access-dv");
+
     int result = 0;
     int canc = vlc_savecancel();
 
diff --git a/modules/access/http/h2conn.c b/modules/access/http/h2conn.c
index cab9610e67..d90a6984ee 100644
--- a/modules/access/http/h2conn.c
+++ b/modules/access/http/h2conn.c
@@ -800,6 +800,8 @@ static void *vlc_h2_recv_thread(void *data)
     struct vlc_h2_parser *parser;
     int canc, val;
 
+    vlc_thread_set_name("vlc-access-h2in");
+
     canc = vlc_savecancel();
     parser = vlc_h2_parse_init(conn, &vlc_h2_parser_callbacks);
     if (unlikely(parser == NULL))
diff --git a/modules/access/http/h2output.c b/modules/access/http/h2output.c
index 74188ef29c..3cf6ade92a 100644
--- a/modules/access/http/h2output.c
+++ b/modules/access/http/h2output.c
@@ -255,7 +255,7 @@ static int vlc_h2_frame_send(struct vlc_tls *tls, struct vlc_h2_frame *f)
 }
 
 /** Output thread */
-static void *vlc_h2_output_thread(void *data)
+static void *output_thread(void *data)
 {
     struct vlc_h2_output *out = data;
     struct vlc_h2_frame *frame;
@@ -283,11 +283,20 @@ static void *vlc_h2_output_thread(void *data)
     return NULL;
 }
 
+static void *vlc_h2_output_thread(void *data)
+{
+    vlc_thread_set_name("vlc-access-h2o");
+
+    return output_thread(data);
+}
+
 static void *vlc_h2_client_output_thread(void *data)
 {
     static const char http2_hello[] = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n";
     struct vlc_h2_output *out = data;
 
+    vlc_thread_set_name("vlc-access-h2oc");
+
     if (vlc_https_send(out->tls, http2_hello, 24) < 24)
     {
         vlc_mutex_lock(&out->lock);
@@ -296,7 +305,7 @@ static void *vlc_h2_client_output_thread(void *data)
         return NULL;
     }
 
-    return vlc_h2_output_thread(data);
+    return output_thread(data);
 }
 
 struct vlc_h2_output *vlc_h2_output_create(struct vlc_tls *tls, bool client)
diff --git a/modules/access/mms/mmstu.c b/modules/access/mms/mmstu.c
index c524b22816..5740480895 100644
--- a/modules/access/mms/mmstu.c
+++ b/modules/access/mms/mmstu.c
@@ -1587,6 +1587,8 @@ static void *KeepAliveThread( void *p_data )
     stream_t *p_access = p_data;
     access_sys_t *p_sys = p_access->p_sys;
 
+    vlc_thread_set_name("vlc-access-mms");
+
     do  /* Send keep-alive every ten seconds */
         mms_CommandSend( p_access, 0x1b, 0, 0, NULL, 0 );
     while (vlc_sem_timedwait( &p_sys->keep_alive.sem,
diff --git a/modules/access/rdp.c b/modules/access/rdp.c
index b1a0fe0bdf..9004eb4da4 100644
--- a/modules/access/rdp.c
+++ b/modules/access/rdp.c
@@ -333,6 +333,9 @@ static void *DemuxThread( void *p_data )
 {
     demux_t *p_demux = (demux_t *) p_data;
     demux_sys_t *p_sys = p_demux->p_sys;
+
+    vlc_thread_set_name("vlc-access-rdp");
+
     p_sys->i_starttime = vlc_tick_now();
     vlc_tick_t i_next_frame_date = vlc_tick_now() + p_sys->i_frame_interval;
     int i_ret;
diff --git a/modules/access/rist.c b/modules/access/rist.c
index 009c17790d..078b4e395d 100644
--- a/modules/access/rist.c
+++ b/modules/access/rist.c
@@ -778,6 +778,8 @@ static void *rist_thread(void *data)
     stream_sys_t *p_sys = p_access->p_sys;
     block_t *pkt_nacks;
 
+    vlc_thread_set_name("vlc-access-rist");
+
     /* Process nacks every 5ms */
     /* We only ask for the relevant ones */
     while ((pkt_nacks = vlc_queue_DequeueKillable(&p_sys->queue,
diff --git a/modules/access/rtp/input.c b/modules/access/rtp/input.c
index d819fe5fff..b969257fbe 100644
--- a/modules/access/rtp/input.c
+++ b/modules/access/rtp/input.c
@@ -112,6 +112,8 @@ void *rtp_dgram_thread (void *opaque)
     vlc_tick_t deadline = VLC_TICK_INVALID;
     struct vlc_dtls *rtp_sock = sys->rtp_sock;
 
+    vlc_thread_set_name("vlc-access-rtp");
+
     for (;;)
     {
         struct pollfd ufd[1];
diff --git a/modules/access/satip.c b/modules/access/satip.c
index 4bb4a563aa..8cd8431085 100644
--- a/modules/access/satip.c
+++ b/modules/access/satip.c
@@ -438,6 +438,9 @@ static void satip_teardown(void *data) {
 static void *satip_thread(void *data) {
     stream_t *access = data;
     access_sys_t *sys = access->p_sys;
+
+    vlc_thread_set_name("vlc-acc-satip");
+
     int sock = sys->udp_sock;
     vlc_tick_t last_recv = vlc_tick_now();
     ssize_t len;
diff --git a/modules/access/screen/wayland.c b/modules/access/screen/wayland.c
index 07dc2c264d..0c3557e442 100644
--- a/modules/access/screen/wayland.c
+++ b/modules/access/screen/wayland.c
@@ -236,6 +236,9 @@ static void *Thread(void *data)
     demux_sys_t *sys = demux->p_sys;
     struct wl_display *display = sys->display;
     struct pollfd ufd[1];
+
+    vlc_thread_set_name("vlc-scr-wayland");
+
     unsigned interval = lroundf(CLOCK_FREQ / (sys->rate * 1000.f));
 
     int canc = vlc_savecancel();
diff --git a/modules/access/v4l2/demux.c b/modules/access/v4l2/demux.c
index 00f02ee76e..eebe814891 100644
--- a/modules/access/v4l2/demux.c
+++ b/modules/access/v4l2/demux.c
@@ -679,6 +679,8 @@ static void *UserPtrThread (void *data)
     struct pollfd ufd[2];
     nfds_t numfds = 1;
 
+    vlc_thread_set_name("vlc-acc-v4l2-ur");
+
     ufd[0].fd = fd;
     ufd[0].events = POLLIN;
 
@@ -729,6 +731,8 @@ static void *MmapThread (void *data)
     struct pollfd ufd[2];
     nfds_t numfds = 1;
 
+    vlc_thread_set_name("vlc-acc-v4l2-mm");
+
     ufd[0].fd = fd;
     ufd[0].events = POLLIN;
 
@@ -780,6 +784,8 @@ static void *ReadThread (void *data)
     struct pollfd ufd[2];
     nfds_t numfds = 1;
 
+    vlc_thread_set_name("vlc-acc-v4l2-in");
+
     ufd[0].fd = fd;
     ufd[0].events = POLLIN;
 
diff --git a/modules/access/vnc.c b/modules/access/vnc.c
index cd003eb575..9aadc72941 100644
--- a/modules/access/vnc.c
+++ b/modules/access/vnc.c
@@ -342,6 +342,8 @@ static void *DemuxThread( void *p_data )
     vlc_tick_t i_next_frame_date = vlc_tick_now() + p_sys->i_frame_interval;
     int i_status;
 
+    vlc_thread_set_name("vlc-access-vnc");
+
     for(;;)
     {
         i_status = WaitForMessage( p_sys->p_client, p_sys->i_frame_interval );
diff --git a/modules/access_output/rist.c b/modules/access_output/rist.c
index 877abcdcfc..d5e2f43419 100644
--- a/modules/access_output/rist.c
+++ b/modules/access_output/rist.c
@@ -421,6 +421,8 @@ static void *rist_thread(void *data)
     int ret;
     ssize_t r;
 
+    vlc_thread_set_name("vlc-acc-ristin");
+
     int poll_sockets = 1;
     pfd[0].fd = p_sys->flow->fd_rtcp;
     pfd[0].events = POLLIN;
@@ -492,6 +494,8 @@ static void* ThreadSend( void *data )
     struct rist_flow *flow = p_sys->flow;
     block_t *out;
 
+    vlc_thread_set_name("vlc-acc-ristout");
+
     while ((out = vlc_queue_DequeueKillable(&p_sys->queue,
                                             &p_sys->dead)) != NULL)
     {
diff --git a/modules/access_output/udp.c b/modules/access_output/udp.c
index e4ffa20f77..f8b4a9f0b1 100644
--- a/modules/access_output/udp.c
+++ b/modules/access_output/udp.c
@@ -354,6 +354,9 @@ static void* ThreadWrite( void *data )
     sout_access_out_t *p_access = data;
     sout_access_out_sys_t *p_sys = p_access->p_sys;
     vlc_tick_t i_date_last = -1;
+
+    vlc_thread_set_name("vlc-access-udpw");
+
     const unsigned i_group = var_GetInteger( p_access,
                                              SOUT_CFG_PREFIX "group" );
     int i_to_send = i_group;
diff --git a/modules/audio_output/audiotrack.c b/modules/audio_output/audiotrack.c
index 7e49388e35..4aa1d16ab0 100644
--- a/modules/audio_output/audiotrack.c
+++ b/modules/audio_output/audiotrack.c
@@ -1782,6 +1782,9 @@ AudioTrack_Thread( void *p_data )
 {
     audio_output_t *p_aout = p_data;
     aout_sys_t *p_sys = p_aout->sys;
+
+    vlc_thread_set_name("vlc-aout-autk");
+
     JNIEnv *env = GET_ENV();
     vlc_tick_t i_play_deadline = 0;
     vlc_tick_t i_last_time_blocked = 0;
diff --git a/modules/audio_output/directsound.c b/modules/audio_output/directsound.c
index 582771d178..03af7102a7 100644
--- a/modules/audio_output/directsound.c
+++ b/modules/audio_output/directsound.c
@@ -1111,6 +1111,8 @@ static void * PlayedDataEraser( void * data )
     vlc_tick_t ticksleep;
     HRESULT dsresult;
 
+    vlc_thread_set_name("vlc-aout-dsound");
+
     for(;;)
     {
         int canc = vlc_savecancel();
diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index 55d0fbb57d..c5b1155e17 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -1055,6 +1055,8 @@ static void *MMThread(void *data)
     aout_sys_t *sys = aout->sys;
     IMMDeviceEnumerator *it = sys->it;
 
+    vlc_thread_set_name("vlc-aout-mmdevice");
+
     EnterMTA();
     IMMDeviceEnumerator_RegisterEndpointNotificationCallback(it,
                                                           &sys->device_events);
diff --git a/modules/codec/dmo/dmo.c b/modules/codec/dmo/dmo.c
index 3656b6cf61..616e730bc1 100644
--- a/modules/codec/dmo/dmo.c
+++ b/modules/codec/dmo/dmo.c
@@ -984,6 +984,8 @@ static void *DecoderThread( void *data )
     decoder_t *p_dec = data;
     decoder_sys_t *p_sys = p_dec->p_sys;
 
+    vlc_thread_set_name("vlc-decoder-dmo");
+
     if( DecOpen( p_dec ) )
         return NULL; /* failed */
 
diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index 041faa9a46..b5680e57de 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -1369,6 +1369,8 @@ static void *OutThread(void *data)
     decoder_t *p_dec = data;
     decoder_sys_t *p_sys = p_dec->p_sys;
 
+    vlc_thread_set_name("vlc-dec-omxil");
+
     vlc_mutex_lock(&p_sys->lock);
     while (!p_sys->b_aborted)
     {
diff --git a/modules/control/cli/cli.c b/modules/control/cli/cli.c
index c741e7fcad..33715ef4bd 100644
--- a/modules/control/cli/cli.c
+++ b/modules/control/cli/cli.c
@@ -352,6 +352,8 @@ error:      wordfree(&we);
 #ifndef _WIN32
 static void *Run(void *data)
 {
+    vlc_thread_set_name("vlc-ctrl-cli");
+
     intf_thread_t *intf = data;
     intf_sys_t *sys = intf->p_sys;
 
diff --git a/modules/control/dbus/dbus.c b/modules/control/dbus/dbus.c
index 0837f64077..a121b8030f 100644
--- a/modules/control/dbus/dbus.c
+++ b/modules/control/dbus/dbus.c
@@ -833,6 +833,8 @@ MPRISEntryPoint ( DBusConnection *p_conn, DBusMessage *p_from, void *p_this )
 
 static void *Run( void *data )
 {
+    vlc_thread_set_name("vlc-ctrl-dbus");
+
     intf_thread_t *p_intf = data;
     intf_sys_t    *p_sys = p_intf->p_sys;
 
diff --git a/modules/control/globalhotkeys/win32.c b/modules/control/globalhotkeys/win32.c
index 18239f5b61..451f60db66 100644
--- a/modules/control/globalhotkeys/win32.c
+++ b/modules/control/globalhotkeys/win32.c
@@ -130,6 +130,8 @@ static void *Thread( void *p_data )
     intf_thread_t *p_intf = p_data;
     intf_sys_t *p_sys = p_intf->p_sys;
 
+    vlc_thread_set_name("vlc-ctrl-hotkeys-win");
+
     /* Window which receives Hotkeys */
     vlc_mutex_lock( &p_sys->lock );
     p_sys->hotkeyWindow =
diff --git a/modules/control/globalhotkeys/xcb.c b/modules/control/globalhotkeys/xcb.c
index 32b2d312c6..9112e8d96a 100644
--- a/modules/control/globalhotkeys/xcb.c
+++ b/modules/control/globalhotkeys/xcb.c
@@ -362,6 +362,8 @@ static void *Thread( void *p_data )
     intf_sys_t *p_sys = p_intf->p_sys;
     xcb_connection_t *p_connection = p_sys->p_connection;
 
+    vlc_thread_set_name("vlc-ctrl-xcbkey");
+
     int canc = vlc_savecancel();
 
     /* */
diff --git a/modules/control/lirc.c b/modules/control/lirc.c
index 818c4c9a3f..be1cc139de 100644
--- a/modules/control/lirc.c
+++ b/modules/control/lirc.c
@@ -156,6 +156,8 @@ static void *Run( void *data )
     intf_thread_t *p_intf = data;
     intf_sys_t *p_sys = p_intf->p_sys;
 
+    vlc_thread_set_name("vlc-ctrl-lirc");
+
     struct pollfd ufd;
     ufd.fd = p_sys->i_fd;
     ufd.events = POLLIN;
diff --git a/modules/control/netsync.c b/modules/control/netsync.c
index 4a75bc5bbd..0a0b4310a5 100644
--- a/modules/control/netsync.c
+++ b/modules/control/netsync.c
@@ -177,6 +177,9 @@ static void *Master(void *handle)
 {
     intf_thread_t *intf = handle;
     intf_sys_t *sys = intf->p_sys;
+
+    vlc_thread_set_name("vlc-ctrl-nsyncm");
+
     for (;;) {
         struct pollfd ufd = { .fd = sys->fd, .events = POLLIN, };
         uint64_t data[2];
@@ -220,6 +223,8 @@ static void *Slave(void *handle)
     intf_thread_t *intf = handle;
     intf_sys_t *sys = intf->p_sys;
 
+    vlc_thread_set_name("vlc-ctrl-nsyncc");
+
     for (;;) {
         struct pollfd ufd = { .fd = sys->fd, .events = POLLIN, };
         uint64_t data[2];
diff --git a/modules/control/ntservice.c b/modules/control/ntservice.c
index 386b853a14..edb11ac2b6 100644
--- a/modules/control/ntservice.c
+++ b/modules/control/ntservice.c
@@ -138,6 +138,8 @@ void Close( vlc_object_t *p_this )
  *****************************************************************************/
 static void *Run( void *data )
 {
+    vlc_thread_set_name("vlc-ctrl-ntservice");
+
     intf_thread_t *p_intf = data;
     SERVICE_TABLE_ENTRY dispatchTable[] =
     {
diff --git a/modules/control/win_msg.c b/modules/control/win_msg.c
index 0e7ae1ba70..b34d863b51 100644
--- a/modules/control/win_msg.c
+++ b/modules/control/win_msg.c
@@ -133,6 +133,8 @@ static LRESULT CALLBACK WMCOPYWNDPROC(HWND hwnd, UINT uMsg,
 
 static void *HelperThread(void *data)
 {
+    vlc_thread_set_name("vlc-ctrl-winmsg");
+
     intf_thread_t *intf = data;
     intf_sys_t *sys = intf->p_sys;
 
diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp
index 0b358fe299..d3b62a477e 100644
--- a/modules/demux/adaptive/PlaylistManager.cpp
+++ b/modules/demux/adaptive/PlaylistManager.cpp
@@ -620,6 +620,8 @@ void PlaylistManager::setBufferingRunState(bool b)
 
 void PlaylistManager::Run()
 {
+    vlc_thread_set_name("vlc-adapt-pllst");
+
     mutex_locker locker {lock};
     const vlc_tick_t i_min_buffering = bufferingLogic->getMinBuffering(playlist);
     const vlc_tick_t i_extra_buffering = bufferingLogic->getMaxBuffering(playlist) - i_min_buffering;
diff --git a/modules/demux/adaptive/http/Downloader.cpp b/modules/demux/adaptive/http/Downloader.cpp
index 666c86abdb..243208f409 100644
--- a/modules/demux/adaptive/http/Downloader.cpp
+++ b/modules/demux/adaptive/http/Downloader.cpp
@@ -92,6 +92,8 @@ void Downloader::DownloadSource(HTTPChunkBufferedSource *source)
 
 void Downloader::Run()
 {
+    vlc_thread_set_name("vlc-adapt-http");
+
     vlc::threads::mutex_locker locker {lock};
     while(1)
     {
diff --git a/modules/demux/mkv/events.cpp b/modules/demux/mkv/events.cpp
index cd7b57f1e9..0ccb2b2528 100644
--- a/modules/demux/mkv/events.cpp
+++ b/modules/demux/mkv/events.cpp
@@ -125,6 +125,8 @@ int event_thread_t::EventKey( vlc_object_t *p_this, char const *,
 
 void event_thread_t::EventThread()
 {
+    vlc_thread_set_name("vlc-mkv-inputev");
+
     vlc_object_t *vlc = VLC_OBJECT(vlc_object_instance(p_demux));
     int canc = vlc_savecancel ();
 
diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c
index 83feac5e13..01f50fc48e 100644
--- a/modules/gui/ncurses.c
+++ b/modules/gui/ncurses.c
@@ -1653,6 +1653,8 @@ static void *Run(void *data)
     intf_thread_t *intf = data;
     intf_sys_t *sys = intf->p_sys;
 
+    vlc_thread_set_name("vlc-ncurses");
+
     while (atomic_load_explicit(&sys->alive, memory_order_relaxed)) {
         Redraw(intf);
         HandleKey(intf);
diff --git a/modules/gui/qt/qt.cpp b/modules/gui/qt/qt.cpp
index d61add4f0e..06a74caee6 100644
--- a/modules/gui/qt/qt.cpp
+++ b/modules/gui/qt/qt.cpp
@@ -569,6 +569,8 @@ static void *Thread( void *obj )
     char *argv[3] = { nullptr };
     int argc = 0;
 
+    vlc_thread_set_name("vlc-qt-main");
+
     auto argvReleaser = vlc::wrap_carray<char*>(argv, [](char* ptr[]) {
         for ( int i = 0; ptr[i] != nullptr; ++i )
             free(ptr[i]);
diff --git a/modules/gui/skins2/src/skin_main.cpp b/modules/gui/skins2/src/skin_main.cpp
index ebb349ddf5..44c3a79c3d 100644
--- a/modules/gui/skins2/src/skin_main.cpp
+++ b/modules/gui/skins2/src/skin_main.cpp
@@ -157,6 +157,8 @@ static void Close( vlc_object_t *p_this )
 //---------------------------------------------------------------------------
 static void *Run( void * p_obj )
 {
+    vlc_thread_set_name("vlc-skins2-loop");
+
     int canc = vlc_savecancel();
 
     intf_thread_t *p_intf = (intf_thread_t *)p_obj;
diff --git a/modules/lua/extension_thread.c b/modules/lua/extension_thread.c
index 628d0c8375..e1268e8b16 100644
--- a/modules/lua/extension_thread.c
+++ b/modules/lua/extension_thread.c
@@ -263,6 +263,8 @@ int PushCommand__( extension_t *p_ext,  bool b_unique, command_type_e i_command,
 /* Thread loop */
 static void* Run( void *data )
 {
+    vlc_thread_set_name("vlc-lua-ext");
+
     extension_t *p_ext = data;
     extensions_manager_t *p_mgr = p_ext->p_sys->p_mgr;
 
diff --git a/modules/lua/intf.c b/modules/lua/intf.c
index 409432e8ec..fa143a0145 100644
--- a/modules/lua/intf.c
+++ b/modules/lua/intf.c
@@ -401,6 +401,8 @@ void Close_LuaIntf( vlc_object_t *p_this )
 
 static void *Run( void *data )
 {
+    vlc_thread_set_name("vlc-lua-intf");
+
     intf_thread_t *p_intf = data;
     intf_sys_t *p_sys = p_intf->p_sys;
     lua_State *L = p_sys->L;
diff --git a/modules/lua/services_discovery.c b/modules/lua/services_discovery.c
index 2dc3621c3b..506cc35c17 100644
--- a/modules/lua/services_discovery.c
+++ b/modules/lua/services_discovery.c
@@ -273,6 +273,8 @@ void Close_LuaSD( vlc_object_t *p_this )
  ****************************************************************************/
 static void* Run( void *data )
 {
+    vlc_thread_set_name("vlc-lua-sd");
+
     services_discovery_t *p_sd = ( services_discovery_t * )data;
     services_discovery_sys_t *p_sys = p_sd->p_sys;
     lua_State *L = p_sys->L;
diff --git a/modules/misc/audioscrobbler.c b/modules/misc/audioscrobbler.c
index c7da3f2775..d880aa1812 100644
--- a/modules/misc/audioscrobbler.c
+++ b/modules/misc/audioscrobbler.c
@@ -670,6 +670,8 @@ static void HandleInterval(vlc_tick_t *next, unsigned int *i_interval)
  *****************************************************************************/
 static void *Run(void *data)
 {
+    vlc_thread_set_name("vlc-audioscrob");
+
     intf_thread_t          *p_intf = data;
     uint8_t                 p_buffer[1024];
     bool                    b_handshaked = false;
diff --git a/modules/misc/fingerprinter.c b/modules/misc/fingerprinter.c
index 3b51e5b23b..db70563e84 100644
--- a/modules/misc/fingerprinter.c
+++ b/modules/misc/fingerprinter.c
@@ -346,6 +346,8 @@ static void fill_metas_with_results( fingerprint_request_t *p_r, acoustid_finger
  *****************************************************************************/
 static void *Run( void *opaque )
 {
+    vlc_thread_set_name("vlc-fingerp");
+
     fingerprinter_thread_t *p_fingerprinter = opaque;
     fingerprinter_sys_t *p_sys = p_fingerprinter->p_sys;
 
diff --git a/modules/services_discovery/microdns.c b/modules/services_discovery/microdns.c
index 16f23d914c..6b19b7b57b 100644
--- a/modules/services_discovery/microdns.c
+++ b/modules/services_discovery/microdns.c
@@ -462,6 +462,8 @@ stop_sd_cb( void *p_this )
 static void *
 RunSD( void *p_this )
 {
+    vlc_thread_set_name("vlc-microdns-sd");
+
     services_discovery_t *p_sd = ( services_discovery_t* )p_this;
     struct discovery_sys *p_sys = p_sd->p_sys;
 
@@ -562,6 +564,8 @@ stop_rd_cb( void *p_this )
 static void *
 RunRD( void *p_this )
 {
+    vlc_thread_set_name("vlc-microdns-rd");
+
     vlc_renderer_discovery_t *p_rd = p_this;
     struct discovery_sys *p_sys = p_rd->p_sys;
 
diff --git a/modules/services_discovery/mtp.c b/modules/services_discovery/mtp.c
index 6692effd29..aa08ffce42 100644
--- a/modules/services_discovery/mtp.c
+++ b/modules/services_discovery/mtp.c
@@ -130,6 +130,8 @@ static void *Run( void *data )
     int i_status = 0;
     services_discovery_t *p_sd = data;
 
+    vlc_thread_set_name("vlc-discov-mtp");
+
     for(;;)
     {
         int canc = vlc_savecancel();
diff --git a/modules/services_discovery/podcast.c b/modules/services_discovery/podcast.c
index 2e54af22b9..5e463448ff 100644
--- a/modules/services_discovery/podcast.c
+++ b/modules/services_discovery/podcast.c
@@ -174,6 +174,8 @@ static void Close( vlc_object_t *p_this )
  *****************************************************************************/
 static void *Run( void *data )
 {
+    vlc_thread_set_name("vlc-discov-podc");
+
     services_discovery_t *p_sd = data;
     services_discovery_sys_t *p_sys  = p_sd->p_sys;
 
diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c
index 0bc85d85bc..226b96b5cf 100644
--- a/modules/services_discovery/sap.c
+++ b/modules/services_discovery/sap.c
@@ -413,6 +413,9 @@ static void *Run( void *data )
     services_discovery_sys_t *p_sys = p_sd->p_sys;
     char *psz_addr;
     int timeout = -1;
+
+    vlc_thread_set_name("vlc-discov-sap");
+
     int canc = vlc_savecancel ();
 
     /* Braindead Winsock DNS resolver will get stuck over 2 seconds per failed
diff --git a/modules/services_discovery/udev.c b/modules/services_discovery/udev.c
index cda59f3774..99860117cd 100644
--- a/modules/services_discovery/udev.c
+++ b/modules/services_discovery/udev.c
@@ -318,6 +318,8 @@ static void Close (vlc_object_t *obj)
 
 static void *Run (void *data)
 {
+    vlc_thread_set_name("vlc-discov-udev");
+
     services_discovery_t *sd = data;
     services_discovery_sys_t *p_sys = sd->p_sys;
     struct udev_monitor *mon = p_sys->monitor;
diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index 054a5d1910..27134d800a 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -267,6 +267,8 @@ namespace SD
 static void *
 SearchThread( void *p_data )
 {
+    vlc_thread_set_name("vlc-upnp-sd");
+
     services_discovery_t *p_sd = ( services_discovery_t* )p_data;
     services_discovery_sys_t *p_sys = reinterpret_cast<services_discovery_sys_t *>( p_sd->p_sys );
 
@@ -1603,6 +1605,8 @@ int MediaRendererList::onEvent( Upnp_EventType event_type,
 
 void *SearchThread(void *data)
 {
+    vlc_thread_set_name("vlc-upnp-rd");
+
     vlc_renderer_discovery_t *p_rd = (vlc_renderer_discovery_t*)data;
     renderer_discovery_sys_t *p_sys = (renderer_discovery_sys_t*)p_rd->p_sys;
     int i_res;
diff --git a/modules/services_discovery/xcb_apps.c b/modules/services_discovery/xcb_apps.c
index d22ea63933..b952884f51 100644
--- a/modules/services_discovery/xcb_apps.c
+++ b/modules/services_discovery/xcb_apps.c
@@ -210,6 +210,8 @@ static void Close (vlc_object_t *obj)
 
 static void *Run (void *data)
 {
+    vlc_thread_set_name("vlc-xcb");
+
     services_discovery_t *sd = data;
     services_discovery_sys_t *p_sys = sd->p_sys;
     xcb_connection_t *conn = p_sys->conn;
@@ -311,7 +313,7 @@ static int cmpapp (const void *a, const void *b)
     if (wa < wb)
         return -1;
     return 0;
-} 
+}
 
 static void UpdateApps (services_discovery_t *sd)
 {
diff --git a/modules/stream_filter/decomp.c b/modules/stream_filter/decomp.c
index ebd3929545..e7418cba2e 100644
--- a/modules/stream_filter/decomp.c
+++ b/modules/stream_filter/decomp.c
@@ -97,6 +97,8 @@ static void cleanup_mmap (void *addr)
 
 static void *Thread (void *data)
 {
+    vlc_thread_set_name("vlc-decomp");
+
     stream_t *stream = data;
     stream_sys_t *p_sys = stream->p_sys;
 #ifdef HAVE_VMSPLICE
diff --git a/modules/stream_filter/hds/hds.c b/modules/stream_filter/hds/hds.c
index acdc7f9791..0b7beec5fb 100644
--- a/modules/stream_filter/hds/hds.c
+++ b/modules/stream_filter/hds/hds.c
@@ -851,6 +851,8 @@ static uint8_t* download_chunk( stream_t *s,
 
 static void* download_thread( void* p )
 {
+    vlc_thread_set_name("vlc-hds-dl");
+
     vlc_object_t* p_this = (vlc_object_t*)p;
     stream_t* s = (stream_t*) p_this;
     stream_sys_t* sys = s->p_sys;
@@ -1098,6 +1100,8 @@ static void maintain_live_chunks(
 
 static void* live_thread( void* p )
 {
+    vlc_thread_set_name("vlc-hds-live");
+
     vlc_object_t* p_this = (vlc_object_t*)p;
     stream_t* s = (stream_t*) p_this;
     stream_sys_t* sys = s->p_sys;
diff --git a/modules/stream_filter/prefetch.c b/modules/stream_filter/prefetch.c
index 1ce217f02a..787afd3416 100644
--- a/modules/stream_filter/prefetch.c
+++ b/modules/stream_filter/prefetch.c
@@ -125,6 +125,8 @@ static int ThreadControl(stream_t *stream, int query, ...)
 
 static void *Thread(void *data)
 {
+    vlc_thread_set_name("vlc-prefetch");
+
     stream_t *stream = data;
     stream_sys_t *sys = stream->p_sys;
     bool paused = false;
diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp b/modules/stream_out/chromecast/chromecast_ctrl.cpp
index 34cdb6ae33..704032500a 100644
--- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
+++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
@@ -616,6 +616,8 @@ void* intf_sys_t::ChromecastThread(void* p_data)
 
 void intf_sys_t::mainLoop()
 {
+    vlc_thread_set_name("vlc-sout-ccast");
+
     vlc_savecancel();
     vlc_interrupt_set( m_ctl_thread_interrupt );
 
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index 68ff34b953..6812ba3cda 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -1324,6 +1324,8 @@ static int  HttpCallback( httpd_file_sys_t *p_args,
  ****************************************************************************/
 static void* ThreadSend( void *data )
 {
+    vlc_thread_set_name("vlc-sout-rtp");
+
 #ifdef _WIN32
 # define ENOBUFS      WSAENOBUFS
 # define EAGAIN       WSAEWOULDBLOCK
@@ -1400,6 +1402,8 @@ static void* ThreadSend( void *data )
 /* This thread dequeues incoming connections (DCCP streaming) */
 static void *rtp_listen_thread( void *data )
 {
+    vlc_thread_set_name("vlc-sout-rtp-in");
+
     sout_stream_id_sys_t *id = data;
 
     assert( id->listen.fd != NULL );
diff --git a/modules/stream_out/sdi/DBMSDIOutput.cpp b/modules/stream_out/sdi/DBMSDIOutput.cpp
index abd2559c5c..bece2f2a4f 100644
--- a/modules/stream_out/sdi/DBMSDIOutput.cpp
+++ b/modules/stream_out/sdi/DBMSDIOutput.cpp
@@ -554,6 +554,8 @@ void * DBMSDIOutput::feederThreadCallback(void *me)
 
 void DBMSDIOutput::feederThread()
 {
+    vlc_thread_set_name("vlc-sout-sdidbm");
+
     vlc_tick_t maxdelay = CLOCK_FREQ/60;
     for(;;)
     {
diff --git a/modules/stream_out/sdi/SDIStream.cpp b/modules/stream_out/sdi/SDIStream.cpp
index ce4588d28c..5f5e1b2664 100644
--- a/modules/stream_out/sdi/SDIStream.cpp
+++ b/modules/stream_out/sdi/SDIStream.cpp
@@ -307,6 +307,8 @@ void * AbstractDecodedStream::decoderThreadCallback(void *me)
 
 void AbstractDecodedStream::decoderThread()
 {
+    vlc_thread_set_name("vlc-sout-sdidec");
+
     struct decoder_owner *p_owner =
             container_of(p_decoder, struct decoder_owner, dec);
 
diff --git a/modules/stream_out/transcode/encoder/video.c b/modules/stream_out/transcode/encoder/video.c
index 4de9f3965a..03dde792d0 100644
--- a/modules/stream_out/transcode/encoder/video.c
+++ b/modules/stream_out/transcode/encoder/video.c
@@ -354,6 +354,9 @@ static void* EncoderThread( void *obj )
 {
     transcode_encoder_t *p_enc = obj;
     picture_t *p_pic = NULL;
+
+    vlc_thread_set_name("vlc-sout-transv");
+
     int canc = vlc_savecancel ();
     block_t *p_block = NULL;
 
diff --git a/modules/video_output/caca.c b/modules/video_output/caca.c
index d4a66c5e37..28b10758ba 100644
--- a/modules/video_output/caca.c
+++ b/modules/video_output/caca.c
@@ -69,6 +69,8 @@ typedef struct vlc_caca_event {
 
 static void *VoutDisplayEventKeyDispatch(void *data)
 {
+    vlc_thread_set_name("vlc-vout-caca");
+
     vout_display_t *vd = data;
     vout_display_sys_t *sys = vd->sys;
     vlc_caca_event_t *event;
diff --git a/modules/video_output/wayland/xdg-shell.c b/modules/video_output/wayland/xdg-shell.c
index 0b0eba0be0..cd4f0be0f1 100644
--- a/modules/video_output/wayland/xdg-shell.c
+++ b/modules/video_output/wayland/xdg-shell.c
@@ -120,6 +120,8 @@ static void cleanup_wl_display_read(void *data)
 /** Background thread for Wayland shell events handling */
 static void *Thread(void *data)
 {
+    vlc_thread_set_name("vlc-wnd-xdg");
+
     vout_window_t *wnd = data;
     vout_window_sys_t *sys = wnd->sys;
     struct wl_display *display = wnd->display.wl;
diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index ad6effbcf3..0a48a30eaa 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -91,6 +91,9 @@ static void *EventThread( void *p_this )
 {
     event_thread_t *p_event = (event_thread_t *)p_this;
     MSG msg;
+
+    vlc_thread_set_name("vlc-vout-hwnd-loop");
+
     int canc = vlc_savecancel ();
 
 
diff --git a/modules/video_output/win32/inhibit.c b/modules/video_output/win32/inhibit.c
index 3dac8113dd..52d7bf5601 100644
--- a/modules/video_output/win32/inhibit.c
+++ b/modules/video_output/win32/inhibit.c
@@ -52,6 +52,8 @@ static void* Run(void* obj)
     vlc_inhibit_t *ih = (vlc_inhibit_t*)obj;
     vlc_inhibit_sys_t *sys = ih->p_sys;
 
+    vlc_thread_set_name("vlc-wnd-inhibit");
+
     vlc_mutex_lock(&sys->mutex);
     while (!sys->exit)
     {
diff --git a/modules/video_output/win32/window.c b/modules/video_output/win32/window.c
index 51ec5ff11a..53c97c208d 100644
--- a/modules/video_output/win32/window.c
+++ b/modules/video_output/win32/window.c
@@ -579,6 +579,8 @@ static void *EventThread( void *p_this )
     vout_window_t *wnd = (vout_window_t *)p_this;
     vout_window_sys_t *sys = wnd->sys;
 
+    vlc_thread_set_name("vlc-wnd-hwnd-loop");
+
     int canc = vlc_savecancel ();
 
     HINSTANCE hInstance = GetModuleHandle(NULL);
diff --git a/modules/video_output/xcb/window.c b/modules/video_output/xcb/window.c
index 5e58d10ebf..a92038129b 100644
--- a/modules/video_output/xcb/window.c
+++ b/modules/video_output/xcb/window.c
@@ -312,6 +312,8 @@ static int ProcessEvent(vout_window_t *wnd, xcb_generic_event_t *ev)
 /** Background thread for X11 events handling */
 static void *Thread (void *data)
 {
+    vlc_thread_set_name("vlc-wnd-xcb");
+
     vout_window_t *wnd = data;
     vout_window_sys_t *p_sys = wnd->sys;
     xcb_connection_t *conn = p_sys->conn;
diff --git a/modules/visualization/glspectrum.c b/modules/visualization/glspectrum.c
index f97c711a26..aec1d9fbe9 100644
--- a/modules/visualization/glspectrum.c
+++ b/modules/visualization/glspectrum.c
@@ -343,6 +343,8 @@ static void drawBars(float heights[])
  */
 static void *Thread( void *p_data )
 {
+    vlc_thread_set_name("vlc-viz-glspect");
+
     filter_t  *p_filter = (filter_t*)p_data;
     filter_sys_t *p_sys = p_filter->p_sys;
     vlc_gl_t *gl = p_sys->gl;
diff --git a/modules/visualization/goom.c b/modules/visualization/goom.c
index 69450e73f7..2748a04453 100644
--- a/modules/visualization/goom.c
+++ b/modules/visualization/goom.c
@@ -280,6 +280,8 @@ static int FillBuffer( int16_t *p_data, int *pi_data,
  *****************************************************************************/
 static void *Thread( void *p_thread_data )
 {
+    vlc_thread_set_name("vlc-viz-goom");
+
     goom_thread_t *p_thread = (goom_thread_t*)p_thread_data;
     date_t i_pts;
     int16_t p_data[2][512];
diff --git a/modules/visualization/projectm.cpp b/modules/visualization/projectm.cpp
index a12ac328b8..f672424ee5 100644
--- a/modules/visualization/projectm.cpp
+++ b/modules/visualization/projectm.cpp
@@ -279,6 +279,8 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
  */
 static void *Thread( void *p_data )
 {
+    vlc_thread_set_name("vlc-viz-projm");
+
     filter_t  *p_filter = (filter_t*)p_data;
     filter_sys_t *p_sys = reinterpret_cast<filter_sys_t *>( p_filter->p_sys );
     vlc_gl_t *gl = p_sys->gl;
diff --git a/modules/visualization/visual/visual.c b/modules/visualization/visual/visual.c
index c3591944ad..13343d0f04 100644
--- a/modules/visualization/visual/visual.c
+++ b/modules/visualization/visual/visual.c
@@ -377,6 +377,8 @@ static block_t *DoRealWork( filter_t *p_filter, block_t *p_in_buf )
 
 static void *Thread( void *data )
 {
+    vlc_thread_set_name("vlc-viz-visu");
+
     filter_t *p_filter = data;
     filter_sys_t *sys = p_filter->p_sys;
     block_t *block;
diff --git a/modules/visualization/vsxu.cpp b/modules/visualization/vsxu.cpp
index 42a09552df..5ff5e0361e 100644
--- a/modules/visualization/vsxu.cpp
+++ b/modules/visualization/vsxu.cpp
@@ -237,6 +237,8 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
  */
 static void *Thread( void *p_data )
 {
+    vlc_thread_set_name("vlc-viz-vsxu");
+
     filter_t  *p_filter = (filter_t*)p_data;
     filter_sys_t *p_sys = p_filter->p_sys;
     vlc_gl_t *gl = p_sys->gl;



More information about the vlc-commits mailing list