...
Code that uses this locking strategy has behavior similar to that of synchronized code that uses the traditional monitor lock. ReentrantLock
also provides several other capabilities. For example, the tryLock()
method immediately returns false when another thread already holds the lock. Further, the java.util.concurrent.locks.ReentrantReadWriteLock
class has multiple-readerreaders/single-writer semantics and is useful when some threads require a lock to write information while other threads require the lock to concurrently read the information.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ba28f6296851d6f2-5f8ec4ee-48524274-9fdc9a35-d85aed83355c5dd854a564c2"><ac:plain-text-body><![CDATA[ | [[JLS 2005 | AA. References#JLS 05]] | [Chapter 17, Threads and Locks | http://java.sun.com/docs/books/jls/third_edition/html/memory.html] | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="618bfc982ee28347-a3b93f4e-49f947fc-bbce8bb0-41e7aa4ccbfd22987189aa60"><ac:plain-text-body><![CDATA[ | [[Halloway 2000 | AA. References#Halloway 00]] |
| ]]></ac:plain-text-body></ac:structured-macro> |
...