浏览代码

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.
Ed Maste 4 年之前
父节点
当前提交
a0f64a6017
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      UI/platform-x11.cpp

+ 2 - 1
UI/platform-x11.cpp

@@ -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; });