summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/004-checker-UnsafeTest18/src/Main.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/004-checker-UnsafeTest18/src/Main.java b/test/004-checker-UnsafeTest18/src/Main.java
index c50613d580..282f9ce0d0 100644
--- a/test/004-checker-UnsafeTest18/src/Main.java
+++ b/test/004-checker-UnsafeTest18/src/Main.java
@@ -133,6 +133,10 @@ public class Main {
private static void fork(Runnable r) {
for (int i = 0; i < 10; i++) {
sThreads[i] = new Thread(r);
+ }
+ // Start the threads only after the full array has been written with new threads,
+ // because one test relies on the contents of this array to be consistent.
+ for (int i = 0; i < 10; i++) {
sThreads[i].start();
}
}