From bc1bb5ddf83797c92f82fea9a07e6b1e96e48dbf Mon Sep 17 00:00:00 2001 From: Willem Jan Withagen Date: Sun, 22 May 2016 23:29:55 +0200 Subject: [PATCH] HeartbeatMap.cc WorkQueue.cc: fix FreeBSD pthread issues - Dont have pthread_getname_np - But do need the correct include files Signed-off-by: Willem Jan Withagen --- src/common/HeartbeatMap.cc | 2 ++ src/common/WorkQueue.cc | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/common/HeartbeatMap.cc b/src/common/HeartbeatMap.cc index 80d2e67684f..9167ba67984 100644 --- a/src/common/HeartbeatMap.cc +++ b/src/common/HeartbeatMap.cc @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include "HeartbeatMap.h" #include "ceph_context.h" diff --git a/src/common/WorkQueue.cc b/src/common/WorkQueue.cc index 85150e42471..f4569cd43f0 100644 --- a/src/common/WorkQueue.cc +++ b/src/common/WorkQueue.cc @@ -95,7 +95,9 @@ void ThreadPool::worker(WorkThread *wt) std::stringstream ss; char name[16] = {0}; +#if !defined(__FreeBSD__) pthread_getname_np(pthread_self(), name, sizeof(name)); +#endif ss << name << " thread " << name; heartbeat_handle_d *hb = cct->get_heartbeat_map()->add_worker(ss.str(), pthread_self()); @@ -300,7 +302,9 @@ void ShardedThreadPool::shardedthreadpool_worker(uint32_t thread_index) std::stringstream ss; char name[16] = {0}; +#if !defined(__FreeBSD__) pthread_getname_np(pthread_self(), name, sizeof(name)); +#endif ss << name << " thread " << name; heartbeat_handle_d *hb = cct->get_heartbeat_map()->add_worker(ss.str(), pthread_self()); -- 2.47.3