From 0a65fc5af18066e96677f96adf6c693c86f8e8ad Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 22 Nov 2019 10:52:55 -0800 Subject: 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. --- host/lib/utils/tasks.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'host/lib/utils') 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); } } -- cgit v1.2.3