diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-05-13 23:33:01 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-05-13 23:33:01 +0000 |
commit | 54e1f4f3a5071a77ec1e69128b232398c2721600 (patch) | |
tree | b8be160bbf32d5ae95f1c461cfffd7c4bbd3611c /tests/Thread_Pool_Test.cpp | |
parent | 046bebe4959afd3aabac9bebed2201c8023672fa (diff) | |
download | ATCD-54e1f4f3a5071a77ec1e69128b232398c2721600.tar.gz |
*** empty log message ***
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 */ |