RTI Connext Modern C++ API Version 7.5.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. This is only required on platforms that do not support automatic thread-specific storage (TSS) cleanup. Refer to the Platform Notes to see if your platform supports automatic TSS cleanup. It will be mentioned in the 'Thread Configuration' sub-section of the platform you are using.

See Unregistering Threads, in the Core Libraries User's Manual, for the equivalent API call in each of the supported language bindings.

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