I'm trying to get Classpath's AWT running. Initializing the GTK+ peers
fails. In the following snippet of code, I catch an
IllegalMonitorStateException right after the call to wait() with the text
of "not monitor owner!". Calling notify() seems to make things bomb.
Any ideas? Threads aren't my speciality.
public GtkMainThread()
{
super (null);
synchronized (mainThreadLock)
{
if (mainThread != null)
throw new IllegalStateException();
mainThread = new Thread(this, "GtkMain");
}
synchronized (this)
{
mainThread.start();
try {
wait();
} catch (InterruptedException e) { }
catch (Exception excep) {
System.err.println("I caught: " + excep);
}
}
System.err.println("End of GTK Main Thread constructor");
}
public void run()
{
synchronized (this)
{
System.err.println("Before GTK init");
gtkInit();
System.err.println("After GTK init");
notify();
System.err.println("After notify"); // Never reached
}
System.err.println("Before GTK Main");
gtkMain();
}
--
Aaron M. Renn ([EMAIL PROTECTED]) http://www.urbanophile.com/arenn/