diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-07-31 21:48:20 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-07-31 21:48:20 +0000 |
commit | 86c5f836d1a679208716a422839d7da38ba41059 (patch) | |
tree | 1b3da514a0eb2064d0b27c62011db9492387b7dc /tests/TSS_Test.cpp | |
parent | 13c10349a654c59c85bb62c7f7b9ab8e1424814c (diff) | |
download | ATCD-86c5f836d1a679208716a422839d7da38ba41059.tar.gz |
added ACE_HAS_INSTANTIATION_PRAGMA support
Diffstat (limited to 'tests/TSS_Test.cpp')
-rw-r--r-- | tests/TSS_Test.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tests/TSS_Test.cpp b/tests/TSS_Test.cpp index 8e540ee58ee..9fd64e866ae 100644 --- a/tests/TSS_Test.cpp +++ b/tests/TSS_Test.cpp @@ -4,7 +4,7 @@ // // = LIBRARY // tests -// +// // = FILENAME // TSS_Test.cpp // @@ -13,11 +13,11 @@ // wrapper transparently ensures that the objects of this class // will be placed in thread-specific storage. All calls on // ACE_TSS::operator->() are delegated to the appropriate method -// in the Errno class. +// in the Errno class. // // = AUTHOR // Prashant Jain and Doug Schmidt -// +// // ============================================================================ #include "ace/Service_Config.h" @@ -25,7 +25,7 @@ #include "TSS_Test_Errno.h" #include "test_config.h" -#if defined (ACE_HAS_THREADS) +#if defined (ACE_HAS_THREADS) static const int ITERATIONS = 100; @@ -48,7 +48,7 @@ static ACE_Null_Mutex cout_lock; typedef ACE_Guard<ACE_Null_Mutex> GUARD; #endif /* ACE_HAS_THREADS */ -extern "C" void +extern "C" void cleanup (void *ptr) { ACE_DEBUG ((LM_DEBUG, "(%t) in cleanup, ptr = %x\n", ptr)); @@ -146,24 +146,27 @@ worker (void *c) return 0; } -extern "C" void +extern "C" void handler (int signum) { ACE_DEBUG ((LM_DEBUG, "signal = %S\n", signum)); ACE_Thread_Manager::instance ()->exit (0); } -#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION) +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_TSS<Errno>; -#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */ +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_TSS<Errno> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + #endif /* ACE_HAS_THREADS */ -int +int main (int, char *[]) { ACE_START_TEST ("TSS_Test"); - + #if defined (ACE_HAS_THREADS) ACE_Thread_Control tc (ACE_Thread_Manager::instance ()); @@ -171,15 +174,15 @@ main (int, char *[]) ACE_Sig_Action sa ((ACE_SignalHandler) handler, SIGINT); ACE_UNUSED_ARG (sa); - if (ACE_Thread_Manager::instance ()->spawn_n (ACE_MAX_THREADS, - ACE_THR_FUNC (&worker), + if (ACE_Thread_Manager::instance ()->spawn_n (ACE_MAX_THREADS, + ACE_THR_FUNC (&worker), (void *) ITERATIONS, THR_BOUND | THR_DETACHED) == -1) ACE_OS::perror ("ACE_Thread_Manager::spawn_n"); ACE_Thread_Manager::instance ()->wait (); #else - ACE_ERROR ((LM_ERROR, + ACE_ERROR ((LM_ERROR, "threads are not supported on this platform\n")); #endif /* ACE_HAS_THREADS */ ACE_END_TEST; |