diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2009-11-09 12:20:30 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2009-11-09 12:20:30 +0000 |
commit | b24a5174b69e7a69f51ae529df08409877c50e0b (patch) | |
tree | dc93adf2489f9a79d13f78a6dc0d58efd7ce9f5a | |
parent | 82b663a31a750529f14ac9c6c0bc1867f84e15dd (diff) | |
download | ATCD-b24a5174b69e7a69f51ae529df08409877c50e0b.tar.gz |
Mon Nov 9 12:20:05 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu>
-rw-r--r-- | ACE/ChangeLog | 8 | ||||
-rw-r--r-- | ACE/tests/Message_Queue_Test.cpp | 9 |
2 files changed, 12 insertions, 5 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index f474f873ab6..30e8236ac05 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,10 +1,16 @@ +Mon Nov 9 12:20:05 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> + + * tests/Message_Queue_Test.cpp: + + Modified to use rand_r, which is actually thread safe. + Mon Nov 9 03:41:21 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu> * tests/Message_Queue_Test.cpp: Another attempt at fixing this problem on Snow Leopard, hopefully less disruptive than the last attempt. - + Sat Nov 7 08:32:47 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl> * ace/Basic_Types.h: diff --git a/ACE/tests/Message_Queue_Test.cpp b/ACE/tests/Message_Queue_Test.cpp index 98bc830cab6..ac8a7135a8b 100644 --- a/ACE/tests/Message_Queue_Test.cpp +++ b/ACE/tests/Message_Queue_Test.cpp @@ -213,10 +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. - const u_int mod = UINT_MAX; - ACE_OS::srand ((size_t)ACE_Thread::self () % mod); - 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; |