Hi friends
I want to know that can a lock be acquired on a class in java program.
Thank you.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Chintan RathodPosted May 31, 2012, 1:33 PM
Lock implementations provide more extensive locking operations than can be obtained using synchronized methods and statements. They allow more flexible structuring, may have quite different properties, and may support multiple associated
Conditionobjects.A lock is a tool for controlling access to a shared resource by multiple threads. Commonly, a lock provides exclusive access to a shared resource: only one thread at a time can acquire the lock and all access to the shared resource requires that the lock be acquired first. However, some locks may allow concurrent access to a shared resource, such as the read lock of a
ReadWriteLock.For more information, http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/locks/Lock.html
Thanks & Regards
==============
Chintan Rathod