summaryrefslogtreecommitdiffstats
path: root/src/common/Thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/Thread.h')
-rw-r--r--src/common/Thread.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/Thread.h b/src/common/Thread.h
index 5242fb5f307..8dc0e6c3cbe 100644
--- a/src/common/Thread.h
+++ b/src/common/Thread.h
@@ -17,13 +17,15 @@
#define CEPH_THREAD_H
#include <functional>
+#include <string>
#include <string_view>
-#include <system_error>
#include <thread>
+#include <cstring>
#include <pthread.h>
#include <sys/types.h>
+#include "include/ceph_assert.h"
#include "include/compat.h"
extern pid_t ceph_gettid();
@@ -65,8 +67,6 @@ class Thread {
// Functions for with std::thread
-void set_thread_name(std::thread& t, const std::string& s);
-std::string get_thread_name(const std::thread& t);
void kill(std::thread& t, int signal);
template<typename Fun, typename... Args>
@@ -75,7 +75,7 @@ std::thread make_named_thread(std::string_view n,
Args&& ...args) {
return std::thread([n = std::string(n)](auto&& fun, auto&& ...args) {
- ceph_pthread_setname(pthread_self(), n.data());
+ ceph_pthread_setname(n.data());
std::invoke(std::forward<Fun>(fun),
std::forward<Args>(args)...);
}, std::forward<Fun>(fun), std::forward<Args>(args)...);