RTI Connext Modern C++ API  Version 6.0.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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.
 

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

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

RTI Connext Modern C++ API Version 6.0.0 Copyright © Sun Mar 3 2019 Real-Time Innovations, Inc