summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2004-01-19 19:35:59 +0000
committerMark Spruiell <mes@zeroc.com>2004-01-19 19:35:59 +0000
commit57760b63c44170e00eb944c119e17ee4e2440f8f (patch)
tree13eb669cc2a6f3c918567b78eff7abad9bf4a9f4
parentremoving old Transform code, tests (diff)
downloadice-57760b63c44170e00eb944c119e17ee4e2440f8f.tar.bz2
ice-57760b63c44170e00eb944c119e17ee4e2440f8f.tar.xz
ice-57760b63c44170e00eb944c119e17ee4e2440f8f.zip
call srand on Win32
-rw-r--r--cpp/CHANGES2
-rw-r--r--cpp/src/IceUtil/Thread.cpp6
2 files changed, 8 insertions, 0 deletions
diff --git a/cpp/CHANGES b/cpp/CHANGES
index e2540e0d776..9c213fc95ee 100644
--- a/cpp/CHANGES
+++ b/cpp/CHANGES
@@ -1,6 +1,8 @@
Changes since version 1.2.0
---------------------------
+- IceUtil::Thread now calls srand() in each new thread (Windows only).
+
- When unmarshaling a string sequence parameter, Ice was not clearing
the vector before appending elements to it. This has been fixed.
diff --git a/cpp/src/IceUtil/Thread.cpp b/cpp/src/IceUtil/Thread.cpp
index bb99ee54841..ba9506965e5 100644
--- a/cpp/src/IceUtil/Thread.cpp
+++ b/cpp/src/IceUtil/Thread.cpp
@@ -189,6 +189,12 @@ startHook(void* arg)
{
IceUtil::Thread* rawThread = static_cast<IceUtil::Thread*>(arg);
+ //
+ // Initialize the random number generator in each thread.
+ //
+ unsigned int seed = static_cast<unsigned int>(IceUtil::Time::now().toMicroSeconds());
+ srand(seed);
+
//
// Ensure that the thread doesn't go away until run() has
// completed.