Set thread-names (libs)

This commit is contained in:
Robin Gareus 2020-03-29 14:56:22 +02:00
parent d6a38d5450
commit c365c6cdb2
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
16 changed files with 33 additions and 3 deletions

View file

@ -19,6 +19,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "ardour/analyser.h"
#include "ardour/audiofilesource.h"
#include "ardour/rc_configuration.h"
@ -27,6 +28,8 @@
#include "pbd/compose.h"
#include "pbd/error.h"
#include "pbd/pthread_utils.h"
#include "pbd/i18n.h"
using namespace std;
@ -51,6 +54,7 @@ Analyser::~Analyser ()
static void
analyser_work ()
{
pthread_set_name ("Analyzer");
Analyser::work ();
}

View file

@ -598,6 +598,7 @@ void
AudioEngine::do_reset_backend()
{
SessionEvent::create_per_thread_pool (X_("Backend reset processing thread"), 1024);
pthread_set_name ("EngineWatchdog");
Glib::Threads::Mutex::Lock guard (_reset_request_lock);
@ -658,6 +659,7 @@ void
AudioEngine::do_devicelist_update()
{
SessionEvent::create_per_thread_pool (X_("Device list update processing thread"), 512);
pthread_set_name ("DeviceList");
Glib::Threads::Mutex::Lock guard (_devicelist_update_lock);

View file

@ -190,6 +190,7 @@ void
AutomationWatch::thread ()
{
pbd_set_thread_priority (pthread_self(), PBD_SCHED_FIFO, AudioEngine::instance()->client_real_time_priority() - 3);
pthread_set_name ("AutomationWatch");
while (_run_thread) {
Glib::usleep ((gulong) floor (Config->get_automation_interval_msecs() * 1000));
timer ();

View file

@ -274,6 +274,7 @@ MidiPatchManager::load_midnams ()
*/
PBD::notify_event_loops_about_thread_creation (pthread_self(), "midi-patch-manager", 8);
pthread_set_name ("MIDNAMLoader");
{
Glib::Threads::Mutex::Lock lm (_lock);

View file

@ -63,6 +63,7 @@ RTTaskList::drop_threads ()
RTTaskList::_thread_run (void *arg)
{
RTTaskList *d = static_cast<RTTaskList *>(arg);
pthread_set_name ("RTTaskList");
d->run ();
pthread_exit (0);
return 0;

View file

@ -6922,6 +6922,7 @@ void *
Session::auto_connect_thread (void *arg)
{
Session *s = static_cast<Session *>(arg);
pthread_set_name (X_("autoconnect"));
s->auto_connect_thread_run ();
pthread_exit (0);
return 0;
@ -6930,7 +6931,6 @@ Session::auto_connect_thread (void *arg)
void
Session::auto_connect_thread_run ()
{
pthread_set_name (X_("autoconnect"));
SessionEvent::create_per_thread_pool (X_("autoconnect"), 1024);
PBD::notify_event_loops_about_thread_creation (pthread_self(), X_("autoconnect"), 1024);
pthread_mutex_lock (&_auto_connect_mutex);

View file

@ -31,6 +31,7 @@
#include "pbd/i18n.h"
#include "pbd/error.h"
#include "pbd/enumwriter.h"
#include "pbd/pthread_utils.h"
#include <glibmm/threads.h>
@ -1087,6 +1088,7 @@ void *
Session::emit_thread (void *arg)
{
Session *s = static_cast<Session *>(arg);
pthread_set_name ("SessionSignals");
s->emit_thread_run ();
pthread_exit (0);
return 0;

View file

@ -63,6 +63,7 @@ static void
peak_thread_work ()
{
SessionEvent::create_per_thread_pool (X_("PeakFile Builder "), 64);
pthread_set_name ("PeakFileBuilder");
while (true) {

View file

@ -20,11 +20,13 @@
#include <stdlib.h>
#include <unistd.h>
#include "ardour/worker.h"
#include <glibmm/timer.h>
#include "pbd/error.h"
#include "pbd/compose.h"
#include "pbd/pthread_utils.h"
#include <glibmm/timer.h>
#include "ardour/worker.h"
namespace ARDOUR {
@ -136,6 +138,8 @@ Worker::emit_responses()
void
Worker::run()
{
pthread_set_name ("LV2Worker");
void* buf = NULL;
size_t buf_size = 0;
while (true) {

View file

@ -5,13 +5,16 @@
#include <string>
#include <glib.h>
#include "pbd/gstdio_compat.h"
#include "pbd/pthread_utils.h"
#include "pbd/ringbuffer.h"
#include "audiographer/flag_debuggable.h"
#include "audiographer/sink.h"
#include "sndfile_writer.h"
#include "sndfile_reader.h"
#include "tmp_file.h"
namespace AudioGrapher
@ -133,6 +136,7 @@ class TmpFileRt
static void * _disk_thread (void *arg)
{
TmpFileRt *d = static_cast<TmpFileRt *>(arg);
pthread_set_name ("ExportDiskIO");
d->disk_thread ();
pthread_exit (0);
return 0;

View file

@ -64,6 +64,7 @@ AlsaMidiIO::~AlsaMidiIO ()
static void * pthread_process (void *arg)
{
AlsaMidiIO *d = static_cast<AlsaMidiIO *>(arg);
pthread_set_name ("AlsaMidiIO");
d->main_process_thread ();
pthread_exit (0);
return 0;

View file

@ -143,6 +143,7 @@ void*
AlsaAudioSlave::_process_thread (void* arg)
{
AlsaAudioSlave* aas = static_cast<AlsaAudioSlave*> (arg);
pthread_set_name ("AlsaAudioSlave");
return aas->process_thread ();
}

View file

@ -504,6 +504,7 @@ CoreAudioBackend::launch_control_app ()
static void * pthread_freewheel (void *arg)
{
CoreAudioBackend *d = static_cast<CoreAudioBackend *>(arg);
pthread_set_name ("CAFreewheel");
d->freewheel_thread ();
pthread_exit (0);
return 0;

View file

@ -47,6 +47,7 @@
#include "pbd/file_utils.h"
#include "pbd/search_path.h"
#include "pbd/pthread_utils.h"
#include "pbd/system_exec.h"
using namespace std;
@ -370,6 +371,7 @@ SystemExec::~SystemExec ()
static void*
interposer_thread (void *arg) {
SystemExec *sex = static_cast<SystemExec *>(arg);
pthread_set_name ("ExecStdOut");
sex->output_interposer();
pthread_exit(0);
return 0;

View file

@ -21,6 +21,7 @@
#include "ardour/lmath.h"
#include "pbd/cpus.h"
#include "pbd/pthread_utils.h"
#include "ardour/audioregion.h"
#include "ardour/audiosource.h"
@ -438,6 +439,7 @@ WaveViewDrawingThread::quit ()
void
WaveViewDrawingThread::run ()
{
pthread_set_name ("WaveViewDrawing");
while (true) {
if (g_atomic_int_get (&_quit)) {

View file

@ -680,6 +680,9 @@ void*
Convlevel::static_main (void* arg)
{
((Convlevel*)arg)->main ();
#if !defined PTW32_VERSION && defined _GNU_SOURCE
pthread_setname_np (pthread_self(), "ZConvlevel");
#endif
return 0;
}