diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-06 18:08:37 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-06 18:08:37 +0000 |
commit | acd971518fa2921c84d1e3825e49402880795546 (patch) | |
tree | 0aa5f6e7aae1f99c69a5099143e3a882544c1d09 /tests/Recursive_Mutex_Test.cpp | |
parent | 66ef036f10ea47a73123e19070e6dca3ad9ad7c4 (diff) | |
download | ATCD-acd971518fa2921c84d1e3825e49402880795546.tar.gz |
only 50 iterations on CHORUS
Diffstat (limited to 'tests/Recursive_Mutex_Test.cpp')
-rw-r--r-- | tests/Recursive_Mutex_Test.cpp | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/tests/Recursive_Mutex_Test.cpp b/tests/Recursive_Mutex_Test.cpp index 219e997ca8e..9ba0ddee93f 100644 --- a/tests/Recursive_Mutex_Test.cpp +++ b/tests/Recursive_Mutex_Test.cpp @@ -4,18 +4,18 @@ // // = LIBRARY // tests -// +// // = FILENAME // Recursive_Mutex_Test.cpp // // = DESCRIPTION // This test program verifies the functionality of the ACE_OS // implementation of recursive mutexes on Win32 and Posix -// pthreads. +// pthreads. // // = AUTHOR // Prashant Jain and Doug C. Schmidt -// +// // ============================================================================ #include "ace/Get_Opt.h" @@ -26,26 +26,32 @@ #if defined (ACE_HAS_THREADS) // Total number of iterations. -static size_t n_iterations = 100; +#if defined (CHORUS) + // Chorus can't handle 100 iterations: + // [amThrd.C:154]: Failed to allocate an AmActor + static size_t n_iterations = 50; +#else /* ! CHORUS */ + static size_t n_iterations = 100; +#endif /* ! CHORUS */ static size_t n_threads = ACE_MAX_THREADS; static void -recursive_worker (size_t nesting_level, - ACE_Recursive_Thread_Mutex *rm) +recursive_worker (size_t nesting_level, + ACE_Recursive_Thread_Mutex *rm) { if (nesting_level < n_iterations) { ACE_ASSERT (rm->acquire () == 0); ACE_DEBUG ((LM_DEBUG, - "(%P|%t) = acquired, nesting = %d, thread id = %u\n", - rm->get_nesting_level (), rm->get_thread_id ())); + "(%P|%t) = acquired, nesting = %d, thread id = %u\n", + rm->get_nesting_level (), rm->get_thread_id ())); recursive_worker (nesting_level + 1, rm); ACE_ASSERT (rm->release () == 0); ACE_DEBUG ((LM_DEBUG, - "(%P|%t) = released, nesting = %d, thread id = %u\n", - rm->get_nesting_level (), rm->get_thread_id ())); + "(%P|%t) = released, nesting = %d, thread id = %u\n", + rm->get_nesting_level (), rm->get_thread_id ())); } } @@ -66,13 +72,13 @@ main (int, char *[]) #if defined (ACE_HAS_THREADS) ACE_Recursive_Thread_Mutex rm; - ACE_Thread_Manager::instance ()->spawn_n (n_threads, - ACE_THR_FUNC (worker), - (void *) &rm); + ACE_Thread_Manager::instance ()->spawn_n (n_threads, + ACE_THR_FUNC (worker), + (void *) &rm); ACE_Thread_Manager::instance ()->wait (); #else - ACE_ERROR ((LM_ERROR, - "ACE doesn't support support process mutexes on this platform (yet)\n")); + ACE_ERROR ((LM_ERROR, + "ACE doesn't support support process mutexes on this platform (yet)\n")); #endif /* ACE_WIN32 */ ACE_END_TEST; return 0; |