提交 a0f64a60 编写于 作者: E Ed Maste 提交者: Jim

UI: fix build on older FreeBSD versions

Include pthread_np.h header and use pthread_set_name_np to fix build
on FreeBSD 12.1.  The Linux-compatible pthread_setname_np alias was
added later.
上级 6d181d97
......@@ -41,6 +41,7 @@
#include <sys/sysctl.h>
#include <sys/user.h>
#include <libprocstat.h>
#include <pthread_np.h>
#include <condition_variable>
#include <mutex>
......@@ -114,7 +115,7 @@ struct RunOnce {
void thr_proc()
{
std::unique_lock<std::mutex> lk(mtx);
pthread_setname_np(pthread_self(), thr_name);
pthread_set_name_np(pthread_self(), thr_name);
name_changed = true;
wait_cv.notify_all();
cv.wait(lk, [this]() { return exiting; });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册