summaryrefslogtreecommitdiff
path: root/cpp/test/IceUtil/thread/StartTest.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2004-04-22 17:54:27 +0000
committerBernard Normier <bernard@zeroc.com>2004-04-22 17:54:27 +0000
commitca990558373e6e1f54dd36b7457b1dd25b5eb332 (patch)
treec8122b48f99eb3571b45aeeae1cdfb8dfd450fe7 /cpp/test/IceUtil/thread/StartTest.cpp
parentfix (diff)
downloadice-ca990558373e6e1f54dd36b7457b1dd25b5eb332.tar.bz2
ice-ca990558373e6e1f54dd36b7457b1dd25b5eb332.tar.xz
ice-ca990558373e6e1f54dd36b7457b1dd25b5eb332.zip
Fixed thread start race condition
Diffstat (limited to 'cpp/test/IceUtil/thread/StartTest.cpp')
-rw-r--r--cpp/test/IceUtil/thread/StartTest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/cpp/test/IceUtil/thread/StartTest.cpp b/cpp/test/IceUtil/thread/StartTest.cpp
index c722df22672..791ffba4b27 100644
--- a/cpp/test/IceUtil/thread/StartTest.cpp
+++ b/cpp/test/IceUtil/thread/StartTest.cpp
@@ -63,4 +63,17 @@ StartTest::run()
gotException = true;
}
test(gotException);
+
+ //
+ // Now let's create a bunch of short-lived threads
+ //
+ for(int i = 0; i < 50; i++)
+ {
+ for(int j = 0; j < 50; j++)
+ {
+ Thread* t = new StartTestThread;
+ t->start().detach();
+ }
+ ThreadControl::sleep(Time::milliSeconds(5));
+ }
}