summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Cleeland <chris.cleeland@gmail.com>2009-10-29 21:34:59 +0000
committerChris Cleeland <chris.cleeland@gmail.com>2009-10-29 21:34:59 +0000
commit18374454ce4b490ec76c130d892af68e0237ee23 (patch)
treeea43a3ebb987507e11ac54fc41cc0d1b999b3785
parent97312897257669cad7e52bdbcfef6c0b0adfe728 (diff)
downloadATCD-18374454ce4b490ec76c130d892af68e0237ee23.tar.gz
Thu Oct 29 21:25:49 UTC 2009 Chris Cleeland <cleeland@ociweb.com>
* tests/Message_Queue_Test.cpp: Reverted change from Tue Oct 27 08:12:25 UTC 2009 William R. Otte <wotte@dre.vanderbilt.edu>. The change was causing core dumps on some platforms due to treating the thread ID as a pointer and dereferencing that pointer. Better to live with compiler warnings than crashes.
-rw-r--r--ACE/ChangeLog10
-rw-r--r--ACE/tests/Message_Queue_Test.cpp16
2 files changed, 12 insertions, 14 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index f3960d5c1ba..da9430ca971 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,13 @@
+Thu Oct 29 21:25:49 UTC 2009 Chris Cleeland <cleeland@ociweb.com>
+
+ * tests/Message_Queue_Test.cpp:
+
+ Reverted change from Tue Oct 27 08:12:25 UTC 2009
+ William R. Otte <wotte@dre.vanderbilt.edu>. The change
+ was causing core dumps on some platforms due to treating
+ the thread ID as a pointer and dereferencing that pointer.
+ Better to live with compiler warnings than crashes.
+
Thu Oct 29 21:04:27 UTC 2009 Olli Savia <ops@iki.fi>
* ace/README:
diff --git a/ACE/tests/Message_Queue_Test.cpp b/ACE/tests/Message_Queue_Test.cpp
index 3c5c0c467be..a0192186797 100644
--- a/ACE/tests/Message_Queue_Test.cpp
+++ b/ACE/tests/Message_Queue_Test.cpp
@@ -123,13 +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.
-
- // Seeding the random number generator like this really isn't a good idea,
- // due to the wild differences between platforms with respect to the definition
- // of ACE_thread_t. These pointer gymnastics are intended to suppress warnings
- // that we really don't care about.
- void *thr_id = reinterpret_cast <void *> (ACE_Thread::self ());
- ACE_OS::srand (*reinterpret_cast <u_int *> (thr_id));
+ ACE_OS::srand ((u_int)ACE_Thread::self ());
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
@@ -219,13 +213,7 @@ 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.
-
- // Seeding the random number generator like this really isn't a good idea,
- // due to the wild differences between platforms with respect to the definition
- // of ACE_thread_t. These pointer gymnastics are intended to suppress warnings
- // that we really don't care about.
- void *thr_id = reinterpret_cast <void *> (ACE_Thread::self ());
- ACE_OS::srand (*reinterpret_cast <u_int *> (thr_id));
+ ACE_OS::srand ((u_int)ACE_Thread::self ());
int multiple = ACE_OS::rand () % 10;
int delay_ms = ACE_OS::rand () % 10;
// The delay usually causes the test to time out in the automated