Known wait/notify bugs in Kaffe? I think I've found one.

Gary Howland gary at systemics.com
Thu Apr 17 18:47:15 PDT 1997


Hi,

I've been using wait/notify in conjunction with the Biss library.  When I run 
my application using Suns JDK on FreeBSD, it works as expected.  When I run it 
using kaffe .83, it doesn't.  Are there any known wait/notify problems?

I can package up my code and make it available for anyone who is interested 
into looking in to the problem further. 

Here is the section of code that is causing the problems, but it may not mean 
much yanked out of context like this ...

The problem is that the waitForClose() method does not return under certain 
circumstances (but the problem is 100% repeatable, and works under Suns JDK)

Gary


    /**
     * The Observer callback
     * This method resumes the suspended thread for that window
     */
    public void
    update(Observable o, Object arg)
    {
        synchronized (arg) 
        {
            windows.put(arg, arg);
            arg.notify();
        }  
    }

    /**    
     * Suspend this thread until the window (or whatever) has finished
     * @param o the Observable object that will call our update method
     */
    public void
    waitForClose(Object obj)
    {  
        synchronized (obj)
        {
            while (windows.remove(obj) == null)
            {
                try {
                    obj.wait();
                }
                catch (InterruptedException e) { throw new RuntimeException("Doh!"
); }
            }
        }
    }




More information about the kaffe mailing list