diff options
author | Elliott Hughes <enh@google.com> | 2011-10-02 13:24:37 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2011-10-02 13:24:37 -0700 |
commit | 7502e2a419f84808518cf212b3d7145c7b959c76 (patch) | |
tree | 0eb3a05d72305db9b758ffc2d283ac5e428f9026 /test/051-thread | |
parent | 5cb5ad27944efb08d4556b3c0d362302e37e832b (diff) | |
download | art-7502e2a419f84808518cf212b3d7145c7b959c76.zip art-7502e2a419f84808518cf212b3d7145c7b959c76.tar.gz art-7502e2a419f84808518cf212b3d7145c7b959c76.tar.bz2 |
Fix the 051-thread test.
This changes Thread::Create to clean up the requested stack size before
passing it to pthread_attr_setstacksize.
I modified the test to work around the inherent raciness in the test, which
currently causes us trouble because with all the debug logging, the thread
that initializes System.out takes longer than 1ms, so the first 40 or so
threads all get woken in non-numeric order.
Change-Id: I8047bf00330aaf4210dcb53a4437b1fe0562179e
Diffstat (limited to 'test/051-thread')
-rw-r--r-- | test/051-thread/expected.txt | 1 | ||||
-rw-r--r-- | test/051-thread/src/Main.java | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/test/051-thread/expected.txt b/test/051-thread/expected.txt index fbe32f6..5370049 100644 --- a/test/051-thread/expected.txt +++ b/test/051-thread/expected.txt @@ -1,3 +1,4 @@ +Initializing System.out... running 0 running 1 running 2 diff --git a/test/051-thread/src/Main.java b/test/051-thread/src/Main.java index 9acc89e..7cc3db4 100644 --- a/test/051-thread/src/Main.java +++ b/test/051-thread/src/Main.java @@ -5,6 +5,8 @@ */ public class Main { public static void main(String[] args) { + System.out.println("Initializing System.out..."); + for (int i = 0; i < 512; i++) { MyThread myThread = new MyThread(); myThread.start(); |