lock « Notify « Java Thread Q&A

Home
Java Thread Q&A
1.concurrency
2.Development
3.Exception
4.Notify
5.Operation
6.Socket
7.State
8.synchronize
9.Thread Safe
10.ThreadPool
Java Thread Q&A » Notify » lock 

1. wait() & notify() - why do they need to possess a lock    coderanch.com

Hi everyone, A newbie question: why when I invoke methods wait() and notify() I need to have an object's lock ? Could someone please explain me giving some example why it would be not a good idea to let one do that ? For me, it looks like an object has some kind of queue and when somebody calls wait(), that ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.