summaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-05-03 13:28:15 +0200
committerLennart Poettering <lennart@poettering.net>2010-05-03 13:28:39 +0200
commitbc7314f14e934750194da5582e7317e8de74e504 (patch)
tree7ab187ecacf8a4deb6b390a649d93e311316bb5b /src/modules
parent22f708a1ece613e011ec8740530b1ed40459891d (diff)
thread: name all threads so that the names appear in /proc/$PID/task/$TID/comm
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/alsa/alsa-sink.c2
-rw-r--r--src/modules/alsa/alsa-source.c2
-rw-r--r--src/modules/bluetooth/module-bluetooth-device.c2
-rw-r--r--src/modules/jack/module-jack-sink.c7
-rw-r--r--src/modules/jack/module-jack-source.c2
-rw-r--r--src/modules/module-combine.c2
-rw-r--r--src/modules/module-esound-sink.c2
-rw-r--r--src/modules/module-null-sink.c2
-rw-r--r--src/modules/module-pipe-sink.c2
-rw-r--r--src/modules/module-pipe-source.c2
-rw-r--r--src/modules/module-sine-source.c2
-rw-r--r--src/modules/module-tunnel.c2
-rw-r--r--src/modules/oss/module-oss.c2
-rw-r--r--src/modules/raop/module-raop-sink.c2
14 files changed, 19 insertions, 14 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 60c10c49..02b5a02b 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1917,7 +1917,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
pa_alsa_dump(PA_LOG_DEBUG, u->pcm_handle);
- if (!(u->thread = pa_thread_new(thread_func, u))) {
+ if (!(u->thread = pa_thread_new("alsa-sink", thread_func, u))) {
pa_log("Failed to create thread.");
goto fail;
}
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index f8b583ea..5ecf6c60 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1744,7 +1744,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
pa_alsa_dump(PA_LOG_DEBUG, u->pcm_handle);
- if (!(u->thread = pa_thread_new(thread_func, u))) {
+ if (!(u->thread = pa_thread_new("alsa-source", thread_func, u))) {
pa_log("Failed to create thread.");
goto fail;
}
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index d6868b84..bb270786 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -2041,7 +2041,7 @@ static int start_thread(struct userdata *u) {
}
#endif
- if (!(u->thread = pa_thread_new(thread_func, u))) {
+ if (!(u->thread = pa_thread_new("bluetooth", thread_func, u))) {
pa_log_error("Failed to create IO thread");
stop_thread(u);
return -1;
diff --git a/src/modules/jack/module-jack-sink.c b/src/modules/jack/module-jack-sink.c
index 9f3e071f..4a0d3847 100644
--- a/src/modules/jack/module-jack-sink.c
+++ b/src/modules/jack/module-jack-sink.c
@@ -197,6 +197,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
return pa_sink_process_msg(o, code, data, offset, memchunk);
}
+/* JACK Callback: This is called when JACK needs some data */
static int jack_process(jack_nframes_t nframes, void *arg) {
struct userdata *u = arg;
unsigned c;
@@ -250,6 +251,7 @@ finish:
pa_log_debug("Thread shutting down");
}
+/* JACK Callback: This is called when JACK triggers an error */
static void jack_error_func(const char*t) {
char *s;
@@ -258,6 +260,7 @@ static void jack_error_func(const char*t) {
pa_xfree(s);
}
+/* JACK Callback: This is called when JACK is set up */
static void jack_init(void *arg) {
struct userdata *u = arg;
@@ -267,6 +270,7 @@ static void jack_init(void *arg) {
pa_make_realtime(u->core->realtime_priority+4);
}
+/* JACK Callback: This is called when JACK kicks us */
static void jack_shutdown(void* arg) {
struct userdata *u = arg;
@@ -274,6 +278,7 @@ static void jack_shutdown(void* arg) {
pa_asyncmsgq_post(u->jack_msgq, PA_MSGOBJECT(u->sink), SINK_MESSAGE_ON_SHUTDOWN, NULL, 0, NULL, NULL);
}
+/* JACK Callback: This is called when JACK changes the buffer size */
static int jack_buffer_size(jack_nframes_t nframes, void *arg) {
struct userdata *u = arg;
@@ -413,7 +418,7 @@ int pa__init(pa_module*m) {
jack_set_thread_init_callback(u->client, jack_init, u);
jack_set_buffer_size_callback(u->client, jack_buffer_size, u);
- if (!(u->thread = pa_thread_new(thread_func, u))) {
+ if (!(u->thread = pa_thread_new("jack-sink", thread_func, u))) {
pa_log("Failed to create thread.");
goto fail;
}
diff --git a/src/modules/jack/module-jack-source.c b/src/modules/jack/module-jack-source.c
index 6c68527b..2d152b38 100644
--- a/src/modules/jack/module-jack-source.c
+++ b/src/modules/jack/module-jack-source.c
@@ -363,7 +363,7 @@ int pa__init(pa_module*m) {
jack_on_shutdown(u->client, jack_shutdown, u);
jack_set_thread_init_callback(u->client, jack_init, u);
- if (!(u->thread = pa_thread_new(thread_func, u))) {
+ if (!(u->thread = pa_thread_new("jack-source", thread_func, u))) {
pa_log("Failed to create thread.");
goto fail;
}
diff --git a/src/modules/module-combine.c b/src/modules/module-combine.c
index cffb901b..5f94fdd2 100644
--- a/src/modules/module-combine.c
+++ b/src/modules/module-combine.c
@@ -1304,7 +1304,7 @@ int pa__init(pa_module*m) {
u->sink_unlink_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_UNLINK], PA_HOOK_EARLY, (pa_hook_cb_t) sink_unlink_hook_cb, u);
u->sink_state_changed_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_STATE_CHANGED], PA_HOOK_NORMAL, (pa_hook_cb_t) sink_state_changed_hook_cb, u);
- if (!(u->thread = pa_thread_new(thread_func, u))) {
+ if (!(u->thread = pa_thread_new("combine", thread_func, u))) {
pa_log("Failed to create thread.");
goto fail;
}
diff --git a/src/modules/module-esound-sink.c b/src/modules/module-esound-sink.c
index d7c678ca..02541e62 100644
--- a/src/modules/module-esound-sink.c
+++ b/src/modules/module-esound-sink.c
@@ -628,7 +628,7 @@ int pa__init(pa_module*m) {
/* Reserve space for the response */
u->read_data = pa_xmalloc(u->read_length = sizeof(int32_t));
- if (!(u->thread = pa_thread_new(thread_func, u))) {
+ if (!(u->thread = pa_thread_new("esound-sink", thread_func, u))) {
pa_log("Failed to create thread.");
goto fail;
}
diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c
index 74a2ebb1..eeb6f6ca 100644
--- a/src/modules/module-null-sink.c
+++ b/src/modules/module-null-sink.c
@@ -317,7 +317,7 @@ int pa__init(pa_module*m) {
pa_sink_set_max_rewind(u->sink, nbytes);
pa_sink_set_max_request(u->sink, nbytes);
- if (!(u->thread = pa_thread_new(thread_func, u))) {
+ if (!(u->thread = pa_thread_new("null-sink", thread_func, u))) {
pa_log("Failed to create thread.");
goto fail;
}
diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c
index 9c169327..887681d2 100644
--- a/src/modules/module-pipe-sink.c
+++ b/src/modules/module-pipe-sink.c
@@ -307,7 +307,7 @@ int pa__init(pa_module*m) {
pollfd->fd = u->fd;
pollfd->events = pollfd->revents = 0;
- if (!(u->thread = pa_thread_new(thread_func, u))) {
+ if (!(u->thread = pa_thread_new("pipe-sink", thread_func, u))) {
pa_log("Failed to create thread.");
goto fail;
}
diff --git a/src/modules/module-pipe-source.c b/src/modules/module-pipe-source.c
index 49104f8d..ca8352f1 100644
--- a/src/modules/module-pipe-source.c
+++ b/src/modules/module-pipe-source.c
@@ -291,7 +291,7 @@ int pa__init(pa_module*m) {
pollfd->fd = u->fd;
pollfd->events = pollfd->revents = 0;
- if (!(u->thread = pa_thread_new(thread_func, u))) {
+ if (!(u->thread = pa_thread_new("pipe-source", thread_func, u))) {
pa_log("Failed to create thread.");
goto fail;
}
diff --git a/src/modules/module-sine-source.c b/src/modules/module-sine-source.c
index 9826e5f4..adb09fed 100644
--- a/src/modules/module-sine-source.c
+++ b/src/modules/module-sine-source.c
@@ -274,7 +274,7 @@ int pa__init(pa_module*m) {
pa_source_set_rtpoll(u->source, u->rtpoll);
pa_source_set_fixed_latency(u->source, u->block_usec);
- if (!(u->thread = pa_thread_new(thread_func, u))) {
+ if (!(u->thread = pa_thread_new("sine-source", thread_func, u))) {
pa_log("Failed to create thread.");
goto fail;
}
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c
index c97de3a1..ce5f8d55 100644
--- a/src/modules/module-tunnel.c
+++ b/src/modules/module-tunnel.c
@@ -2014,7 +2014,7 @@ int pa__init(pa_module*m) {
u->fragsize = (uint32_t) -1;
#endif
- if (!(u->thread = pa_thread_new(thread_func, u))) {
+ if (!(u->thread = pa_thread_new("module-tunnel", thread_func, u))) {
pa_log("Failed to create thread.");
goto fail;
}
diff --git a/src/modules/oss/module-oss.c b/src/modules/oss/module-oss.c
index 71536260..ba9b99e0 100644
--- a/src/modules/oss/module-oss.c
+++ b/src/modules/oss/module-oss.c
@@ -1456,7 +1456,7 @@ go_on:
pa_memchunk_reset(&u->memchunk);
- if (!(u->thread = pa_thread_new(thread_func, u))) {
+ if (!(u->thread = pa_thread_new("oss", thread_func, u))) {
pa_log("Failed to create thread.");
goto fail;
}
diff --git a/src/modules/raop/module-raop-sink.c b/src/modules/raop/module-raop-sink.c
index ac48ab10..466488ed 100644
--- a/src/modules/raop/module-raop-sink.c
+++ b/src/modules/raop/module-raop-sink.c
@@ -620,7 +620,7 @@ int pa__init(pa_module*m) {
pa_raop_client_set_callback(u->raop, on_connection, u);
pa_raop_client_set_closed_callback(u->raop, on_close, u);
- if (!(u->thread = pa_thread_new(thread_func, u))) {
+ if (!(u->thread = pa_thread_new("raop-sink", thread_func, u))) {
pa_log("Failed to create thread.");
goto fail;
}