The moose likes Threads and Synchronization and the fly likes What is wrong here? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "What is wrong here?" Watch "What is wrong here?" New topic
Author

What is wrong here?

arun mahajan
Ranch Hand

Joined: Dec 07, 2001
Posts: 304
Hello,
I was making following simple program and it is giving eror:
java.lang.IllegalMonitorStateException: current thread not owner
If I use sleep insteand of wait() method it works.
What could be the reason? Pl help.
regards,
Arun :roll:

arun mahajan
Ranch Hand

Joined: Dec 07, 2001
Posts: 304
Oh I am sorry. I found the error. Methods are not synchronized. Thanks any way.
regards,
Arun
 
 
subject: What is wrong here?
 
Threads others viewed
isInterrupted() or interrupted() !!!!
Thread
synchronized
wait & notify
notifyAll() not working
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture