Patch: Thread_1 fixlet

Bryce McKinlay bryce@albatross.co.nz
Fri Dec 15 23:51:00 GMT 2000


Tom Tromey wrote:

> This fixes a bug in the test suite.  We were expecting the wrong
> result.
>
> 2000-12-15  Tom Tromey  <tromey@redhat.com>
>
>         * libjava.lang/Thread_1.out: Expect `0' active count.

Hmm... Thread_1 has a race condition. The second thread can end up
calling notify() before the first thread calls wait(). This patch should
fix it, but we could probibly just delete that test. I think everything
it does is covered by the various other Thread_* tests.

  [ bryce ]


Index: Thread_1.java
===================================================================
RCS file: /cvs/gcc/egcs/libjava/testsuite/libjava.lang/Thread_1.java,v
retrieving revision 1.2
diff -u -r1.2 Thread_1.java
--- Thread_1.java       1999/07/02 15:44:10     1.2
+++ Thread_1.java       2000/12/16 07:41:27
@@ -137,6 +137,7 @@
     try
       {
        nt.start();
+       Thread.sleep(20);
        dt.start();

        // Don't wait for the threads if we're doing the exit test.




More information about the Java-patches mailing list