[Bug 69] New: wait() and notify() are broken

[email protected]
Newsgroups gmane.comp.java.vm.sablevm.bugs
Message-ID <[email protected]>
http://sablevm.org/bugs/show_bug.cgi?id=69

           Summary: wait() and notify() are broken
           Product: SableVM
           Version: staging
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: default
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]


A thread waiting on an object() is not awaken by notify().

Here's a test case (you should see DONE just after NOTIFY): 

public class Wait {
    public static void main(String[] args) throws InterruptedException {
        new Wait().go();
    }
    public synchronized void go() throws InterruptedException {
        final Wait wait = this;
        new Thread() {
                public void run() {
                    try {
                        Thread.currentThread().sleep(2*1000);
                    } catch(InterruptedException e) {
                        System.out.println("CAUGHT InterruptedException");
                    }
                    System.out.println("NOTIFY");
                    synchronized (wait) {
                        wait.notify();
                    }
                }
            }.start();
        System.out.println("WAIT");
        wait(5*1000);
        System.out.println("DONE");
    }
}



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are the QA contact for the bug, or are watching the QA contact.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.