Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common/ceph_timer: set thread name #34936

Merged
merged 2 commits into from
May 22, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/common/ceph_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <boost/intrusive/set.hpp>

#include "include/function2.hpp"
#include "include/compat.h"

namespace bi = boost::intrusive;
namespace ceph {
Expand Down Expand Up @@ -145,6 +146,7 @@ class timer {
public:
timer() : suspended(false) {
thread = std::thread(&timer::timer_thread, this);
ceph_pthread_setname(thread.native_handle(), "ceph_timer");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to use make_named_thread from common/Thread.h (but you don't have to, either way is fine.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the review :-)
I saw that there are a few other wrappers to handle naming, but figured this was less intrusive. Happy to change it if somebody feels strongly about it though.

}

// Create a suspended timer, jobs will be executed in order when
Expand Down