threads and Window.dispose
From: John Harrison (john_andronicus_at_hotmail.com)
Date: 03/29/04
- Next message: Tony Morris: "Re: threads and Window.dispose"
- Previous message: Thomas Weidenfeller: "Re: Iconized image size"
- Next in thread: Tony Morris: "Re: threads and Window.dispose"
- Reply: Tony Morris: "Re: threads and Window.dispose"
- Reply: Babu Kalakrishnan: "Re: threads and Window.dispose"
- Reply: SPG: "Re: threads and Window.dispose"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 29 Mar 2004 11:52:18 +0100
I'm working on a large java app which was written by someone else. I'm also
a java newbie.
My problem is that the application hangs on Mac OS X with the 1.4.2
platform, it did not hang on 1.3.1 and it does not hang on Windows.
It seems to be a thread deadlock situation and the cause is code like the
following
class SomeWindow extends Window
{
...
public void dispose()
{
synchronized (this)
{
// some app specific code
...
super.dispose();
}
}
...
}
The problem goes away if I remove the synchronized keyword, it also goes
away if I remove the call to super.dispose() from inside the synchronized
clause.
So my question is whether code like the above is legitimate, or is there
something wrong with disposing of a Window while synchronizing on it.
Thanks,
John
- Next message: Tony Morris: "Re: threads and Window.dispose"
- Previous message: Thomas Weidenfeller: "Re: Iconized image size"
- Next in thread: Tony Morris: "Re: threads and Window.dispose"
- Reply: Tony Morris: "Re: threads and Window.dispose"
- Reply: Babu Kalakrishnan: "Re: threads and Window.dispose"
- Reply: SPG: "Re: threads and Window.dispose"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|