Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitor: IllegalMonitorStateException #61

Open
itaiag opened this issue May 6, 2013 · 0 comments
Open

Monitor: IllegalMonitorStateException #61

itaiag opened this issue May 6, 2013 · 0 comments
Labels

Comments

@itaiag
Copy link
Contributor

itaiag commented May 6, 2013

Reported by: adrian.wyssmann
monitors.waitForMonitor(xxx) in a test case throws an IllegalMonitorStateException?
java.lang.IllegalMonitorStateException
at java.lang.Object.wait(Native Method)
at jsystem.framework.monitor.MonitorsManager.waitForMonitor(MonitorsManager.java:131)
In the source code MonitorsManager?.java the monitor object is synchronize.
public void waitForMonitor(Monitor monitor, long timeout) throws Exception {
...
synchronized (monitor) {
t.wait(timeout);
}
...
but the thread should be synchronized, as the wait() is done on the thread object
public void waitForMonitor(Monitor monitor, long timeout) throws Exception {
...
synchronized (t) {
t.wait(timeout);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant