]> git.ipfire.org Git - thirdparty/collectd.git/commit
Set the thread name before detaching the thread 2762/head
authorMichael Kaufmann <mail@michael-kaufmann.ch>
Thu, 3 May 2018 20:20:33 +0000 (22:20 +0200)
committerMichael Kaufmann <mail@michael-kaufmann.ch>
Thu, 3 Oct 2019 09:38:30 +0000 (11:38 +0200)
commitc1be4a7309d0fdaaa8a449cb26a92decd90c2a12
treeb53f94837b1660f4c0bc5785bdbc618d7406f996
parentebb558dd443046558eaf0bb3ec51566ad305190f
Set the thread name before detaching the thread

pthread_setname_np() does not work reliably when a thread has been
created in a detached state. Set the thread name first, and then call
pthread_detach() afterwards (if necessary).

This prevents error messages like this one:
set_thread_name("unixsock conn"): No such process
24 files changed:
src/amqp.c
src/amqp1.c
src/connectivity.c
src/daemon/plugin.c
src/daemon/plugin.h
src/daemon/plugin_mock.c
src/dns.c
src/email.c
src/exec.c
src/gmond.c
src/gps.c
src/ipmi.c
src/mcelog.c
src/mqtt.c
src/network.c
src/pinba.c
src/ping.c
src/procevent.c
src/python.c
src/rrdtool.c
src/sigrok.c
src/sysevent.c
src/unixsock.c
src/utils/ovs/ovs.c