diff options
Diffstat (limited to 'runtime/wtp.c')
-rw-r--r-- | runtime/wtp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/wtp.c b/runtime/wtp.c index 218a5db6..02662cde 100644 --- a/runtime/wtp.c +++ b/runtime/wtp.c @@ -40,6 +40,7 @@ #include <unistd.h> #include <errno.h> #include <atomic.h> +#include <sys/prctl.h> #ifdef OS_SOLARIS # include <sched.h> @@ -433,6 +434,11 @@ wtpWorker(void *arg) /* the arg is actually a wti object, even though we are in sigfillset(&sigSet); pthread_sigmask(SIG_BLOCK, &sigSet, NULL); + /* set thread name - we ignore if the call fails, has no harsh consequences... */ + if(prctl(PR_SET_NAME, wtpGetDbgHdr(pThis), 0, 0, 0) != 0) { + DBGPRINTF("prctl failed, not setting thread name for '%s'\n", wtpGetDbgHdr(pThis)); + } + BEGIN_MTX_PROTECTED_OPERATIONS(&pThis->mut, LOCK_MUTEX); /* do some late initialization */ |