GitHub Actions: Try MSVC builds with /std:c++17 and 20
[ACE_TAO.git] / ACE / ace / TSS_Adapter.cpp
blobee1f55fdcaca6ab65accc12c56a996848508066d
1 /**
2 * @file TSS_Adapter.cpp
4 * Originally in Synch.cpp
6 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
7 */
9 #include "ace/TSS_Adapter.h"
11 #if defined (ACE_HAS_ALLOC_HOOKS)
12 # include "ace/Malloc_Base.h"
13 #endif /* ACE_HAS_ALLOC_HOOKS */
15 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
17 ACE_TSS_Adapter::ACE_TSS_Adapter (void *object, ACE_THR_DEST f)
18 : ts_obj_ (object),
19 func_ (f)
23 ACE_ALLOC_HOOK_DEFINE(ACE_TSS_Adapter);
25 void
26 ACE_TSS_Adapter::cleanup (void)
28 (*this->func_)(this->ts_obj_); // call cleanup routine for ts_obj_
31 ACE_END_VERSIONED_NAMESPACE_DECL
33 extern "C" ACE_Export void
34 ACE_TSS_C_cleanup (void *object)
36 if (object != 0)
38 ACE_TSS_Adapter * const tss_adapter = (ACE_TSS_Adapter *) object;
39 // Perform cleanup on the real TS object.
40 tss_adapter->cleanup ();
41 // Delete the adapter object.
42 delete tss_adapter;