Template Class ThreadNameUpdatingNodelet
Defined in File thread_name_updating_nodelet.hpp
Inheritance Relationships
Base Type
public nodelet::Nodelet
Derived Type
public cras::NodeletBase<::nodelet::Nodelet >(Template Class NodeletBase)
Class Documentation
-
template<typename NodeletType = ::nodelet::Nodelet>
class ThreadNameUpdatingNodelet : public virtual nodelet::Nodelet This mixin allows the nodelet to update the OS name of the thread in which it is currently executing.
- Template Parameters:
NodeletType – Type of the base nodelet.
Subclassed by cras::NodeletBase<::nodelet::Nodelet >
Public Functions
-
~ThreadNameUpdatingNodelet() override
Protected Functions
-
void updateThreadName() const
Set custom name of the current thread to this nodelet’s name.
Note
The name will be automatically shortened if longer than 15 chars.
Note
You can see the custom names in htop when you enable display of custom thread names in options.
Note
This function doesn’t reset the name back to the original.
Note
You should call this function at the beginning of all your callbacks.
Note
This function is actually pretty fast. It can be called more than 1 million times per second.