aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/utils
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-11-22 10:52:55 -0800
committerMartin Braun <martin.braun@ettus.com>2019-11-26 12:21:35 -0800
commit0a65fc5af18066e96677f96adf6c693c86f8e8ad (patch)
treef9393679f67243b31c1e48d401b1e0fbb4fcba50 /host/lib/utils
parent6a6d5998f82d97ae754895e3e6f35d3b4bd2cb53 (diff)
downloaduhd-0a65fc5af18066e96677f96adf6c693c86f8e8ad.tar.gz
uhd-0a65fc5af18066e96677f96adf6c693c86f8e8ad.tar.bz2
uhd-0a65fc5af18066e96677f96adf6c693c86f8e8ad.zip
utils: tasks: Use uhd::set_thread_name()
This is a more portable option to set thread names. References to pthreads are now limited to thread.cpp, where they belong.
Diffstat (limited to 'host/lib/utils')
-rw-r--r--host/lib/utils/tasks.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/host/lib/utils/tasks.cpp b/host/lib/utils/tasks.cpp
index 658c361a9..a2d7f82d3 100644
--- a/host/lib/utils/tasks.cpp
+++ b/host/lib/utils/tasks.cpp
@@ -29,9 +29,7 @@ public:
{
_task = std::thread([this, task_fcn](){ this->task_loop(task_fcn); });
if (not name.empty()) {
-#ifdef HAVE_PTHREAD_SETNAME
- pthread_setname_np(_task->native_handle(), name.substr(0,16).c_str());
-#endif /* HAVE_PTHREAD_SETNAME */
+ set_thread_name(&_task, name);
}
}