Hi friends
I want to know that can a lock be acquired on a class in java program.
Thank you.
Lock be acquired on a class in java program
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Chintan RathodRank #516 · 4.8K reputationPosted May 31, 2012, 9:33 AM EDT
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