diff options
Diffstat (limited to 'tests/Message_Queue_Test.cpp')
-rw-r--r-- | tests/Message_Queue_Test.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/Message_Queue_Test.cpp b/tests/Message_Queue_Test.cpp index a0192186797..ac8a7135a8b 100644 --- a/tests/Message_Queue_Test.cpp +++ b/tests/Message_Queue_Test.cpp @@ -123,7 +123,7 @@ Counting_Test_Producer::svc (void) // correct. // Also, to be sure there's not just 1 producer and 1 consumer pinging // back and forth, make the producers randomly delay between blocks. - ACE_OS::srand ((u_int)ACE_Thread::self ()); + ACE_OS::srand ((u_int) ACE_OS::time ()); int multiple = ACE_OS::rand () % 10; int delay_ms = (ACE_OS::rand () % 10) / 2; // The delay usually causes the test to time out in the automated @@ -213,9 +213,11 @@ Counting_Test_Consumer::svc (void) // a calculated number of blocks then stop; the test checker will determine // if the number consumed plus the number remaining is correct for the // number produced. - ACE_OS::srand ((u_int)ACE_Thread::self ()); - int multiple = ACE_OS::rand () % 10; - int delay_ms = ACE_OS::rand () % 10; + + ACE_RANDR_TYPE seed = ACE_OS::time (); + + int multiple = ACE_OS::rand_r (seed) % 10; + int delay_ms = ACE_OS::rand_r (seed) % 10; // The delay usually causes the test to time out in the automated // regression testing. I just left it here in case it's needed someday. delay_ms = 0; |