]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
HeartbeatMap.cc WorkQueue.cc: fix FreeBSD pthread issues 9178/head
authorWillem Jan Withagen <wjw@digiware.nl>
Sun, 22 May 2016 21:29:55 +0000 (23:29 +0200)
committerWillem Jan Withagen <wjw@digiware.nl>
Wed, 25 May 2016 10:13:00 +0000 (12:13 +0200)
 - Dont have pthread_getname_np
 - But do need the correct include files

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
src/common/HeartbeatMap.cc
src/common/WorkQueue.cc

index 80d2e67684fba8630b9642ce247f2a9ea2808abb..9167ba67984664cf6ce70bb738b19b3bd93329eb 100644 (file)
@@ -17,6 +17,8 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <errno.h>
+#include <pthread.h>
+#include <signal.h>
 
 #include "HeartbeatMap.h"
 #include "ceph_context.h"
index 85150e42471a653131b3460680806b78e8801e22..f4569cd43f050de78bdf32b04e61b23b22058749 100644 (file)
@@ -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());