diff options
Diffstat (limited to 'tests/Thread_Pool_Test.cpp')
-rw-r--r-- | tests/Thread_Pool_Test.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/Thread_Pool_Test.cpp b/tests/Thread_Pool_Test.cpp index 6350756a438..5e5253163a8 100644 --- a/tests/Thread_Pool_Test.cpp +++ b/tests/Thread_Pool_Test.cpp @@ -138,10 +138,10 @@ Thread_Pool::open (void *) "(%t) producer start, dumping the Thread_Pool\n")); this->dump (); - ACE_Message_Block *mb; - - for (size_t count = 0;;) + for (size_t count = 0; count < n_iterations; count++) { + ACE_Message_Block *mb = 0; + // Allocate a new message. ACE_NEW_RETURN (mb, ACE_Message_Block (BUFSIZ, ACE_Message_Block::MB_DATA, @@ -151,11 +151,6 @@ Thread_Pool::open (void *) ACE_OS::sprintf (mb->rd_ptr (), "%d\n", count); int n = ACE_OS::strlen (mb->rd_ptr ()); - if (count == n_iterations) - break; - else - count++; - if (count == 0 || (count % 20 == 0)) ACE_OS::sleep (1); @@ -174,6 +169,8 @@ Thread_Pool::open (void *) this->thr_count ())); this->dump (); + ACE_Message_Block *mb = 0; + ACE_NEW_RETURN (mb, ACE_Message_Block (0, ACE_Message_Block::MB_DATA, 0, 0, 0, &this->lock_adapter_), @@ -231,6 +228,7 @@ main (int, char *[]) ACE_ASSERT (thread_pool.msg_queue ()->is_empty ()); ACE_DEBUG ((LM_DEBUG, "(%t) destroying worker tasks and exiting...\n")); + #else ACE_ERROR ((LM_ERROR, "threads not supported on this platform\n")); #endif /* ACE_HAS_THREADS */ |