RTI Connext Modern C++ API Version 7.2.0
rti::core::UnregisterThreadOnExit Class Reference

<<extension>> Utility that calls rti::core::unregister_thread when leaving scope More...

#include <rti/core/thread.hpp>

Public Member Functions

 ~UnregisterThreadOnExit ()
 Calls rti::core::unregister_thread. More...
 

Detailed Description

<<extension>> Utility that calls rti::core::unregister_thread when leaving scope

Declare an instance of this type in a thread function before any DDS API is called. After the function exits, this variable will be destroyed and the thread unregistered after everything else.

For example:

void my_thread()
{
// Whenever my_thread leaves, rti::core::unregister_thread will be called.
UnregisterThreadOnExit unregister_thread_on_exit;
// Use DDS API
}

Constructor & Destructor Documentation

◆ ~UnregisterThreadOnExit()

rti::core::UnregisterThreadOnExit::~UnregisterThreadOnExit ( )
inline