From: Willem Jan Withagen Date: Sun, 22 May 2016 21:29:55 +0000 (+0200) Subject: HeartbeatMap.cc WorkQueue.cc: fix FreeBSD pthread issues X-Git-Tag: v11.0.0~319^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bc1bb5ddf83797c92f82fea9a07e6b1e96e48dbf;p=ceph.git 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 --- 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());