File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Threads and Synchronization and the fly likes threads concepts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "threads concepts" Watch "threads concepts" New topic

threads concepts

nitiish chinnaraju

Joined: Jan 16, 2014
Posts: 13

why the wait is not working?
Roger Sterling
Ranch Hand

Joined: Apr 06, 2012
Posts: 426

We need two things : 1. put your code in [c ode] tags and 2. Please ask a specific question in the context of what you tried to do to fix your issue.
Chan Ag

Joined: Sep 06, 2012
Posts: 1089
Roger is right. Please UseCodeTags while posting code ( of any length ).
I've added your post this time.

Also please note that ItDoesntWorkIsUseless
So please ask specific questions, as that increases your chances
of getting a help here.
Chris Hurst
Ranch Hand

Joined: Oct 26, 2003
Posts: 443

Your wait needs to be in a synchronized block of some form ;-) or you'll get a nasty run time error ;-)

After that you'll need a notify in another thread if you want your wait to wake up (or a time limit on the wait itself).

"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
subject: threads concepts
It's not a secret anymore!