This is the mail archive of the java-patches@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch: Thread_1 fixlet


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]