summaryrefslogtreecommitdiffstats
path: root/src/common/Thread.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/Thread.cc')
-rw-r--r--src/common/Thread.cc22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/common/Thread.cc b/src/common/Thread.cc
index 3903e8c0ed7..c714aa0aa87 100644
--- a/src/common/Thread.cc
+++ b/src/common/Thread.cc
@@ -83,7 +83,7 @@ void *Thread::entry_wrapper()
if (pid && cpuid >= 0)
_set_affinity(cpuid);
- ceph_pthread_setname(pthread_self(), Thread::thread_name.c_str());
+ ceph_pthread_setname(thread_name.c_str());
return entry();
}
@@ -154,7 +154,7 @@ int Thread::try_create(size_t stacksize)
void Thread::create(const char *name, size_t stacksize)
{
ceph_assert(strlen(name) < 16);
- Thread::thread_name = name;
+ thread_name = name;
int ret = try_create(stacksize);
if (ret != 0) {
@@ -203,24 +203,6 @@ int Thread::set_affinity(int id)
// Functions for std::thread
// =========================
-void set_thread_name(std::thread& t, const std::string& s) {
- int r = ceph_pthread_setname(t.native_handle(), s.c_str());
- if (r != 0) {
- throw std::system_error(r, std::generic_category());
- }
-}
-std::string get_thread_name(const std::thread& t) {
- std::string s(256, '\0');
-
- int r = ceph_pthread_getname(const_cast<std::thread&>(t).native_handle(),
- s.data(), s.length());
- if (r != 0) {
- throw std::system_error(r, std::generic_category());
- }
- s.resize(std::strlen(s.data()));
- return s;
-}
-
void kill(std::thread& t, int signal)
{
auto r = ceph_pthread_kill(t.native_handle(), signal);