diff options
author | Rob Norris <robn@despairlabs.com> | 2024-04-28 01:03:11 +0000 |
---|---|---|
committer | Brian Behlendorf <behlendorf1@llnl.gov> | 2024-05-01 17:51:44 +0000 |
commit | 4429ad9276cea193bb29463a7d6c38367d0d78ce (patch) | |
tree | c8d3b13c3996a732dc9d439e8cb35661a4c93936 /lib | |
parent | 7ac00d3c26652892e01956af29d087362ab29410 (diff) | |
download | src-4429ad9276cea193bb29463a7d6c38367d0d78ce.tar.gz src-4429ad9276cea193bb29463a7d6c38367d0d78ce.zip |
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libzpool/kernel.c | 5 | ||||
-rw-r--r-- | lib/libzpool/taskq.c | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/libzpool/kernel.c b/lib/libzpool/kernel.c index ffad7fc02bc9..a3930ee07f73 100644 --- a/lib/libzpool/kernel.c +++ b/lib/libzpool/kernel.c @@ -92,7 +92,8 @@ zk_thread_wrapper(void *arg) } kthread_t * -zk_thread_create(void (*func)(void *), void *arg, size_t stksize, int state) +zk_thread_create(const char *name, void (*func)(void *), void *arg, + size_t stksize, int state) { pthread_attr_t attr; pthread_t tid; @@ -140,6 +141,8 @@ zk_thread_create(void (*func)(void *), void *arg, size_t stksize, int state) VERIFY0(pthread_create(&tid, &attr, zk_thread_wrapper, ztw)); VERIFY0(pthread_attr_destroy(&attr)); + pthread_setname_np(tid, name); + return ((void *)(uintptr_t)tid); } diff --git a/lib/libzpool/taskq.c b/lib/libzpool/taskq.c index 99a181ec3c93..5fb2283cf0b1 100644 --- a/lib/libzpool/taskq.c +++ b/lib/libzpool/taskq.c @@ -295,8 +295,8 @@ taskq_create(const char *name, int nthreads, pri_t pri, } for (t = 0; t < nthreads; t++) - VERIFY((tq->tq_threadlist[t] = thread_create(NULL, 0, - taskq_thread, tq, 0, &p0, TS_RUN, pri)) != NULL); + VERIFY((tq->tq_threadlist[t] = thread_create_named(tq->tq_name, + NULL, 0, taskq_thread, tq, 0, &p0, TS_RUN, pri)) != NULL); return (tq); } |