This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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 Elasticsearch in Action this week in the Big Data 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: 1051
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: 430

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
I agree. Here's the link:
subject: threads concepts