-
Enhancement
-
Resolution: Fixed
-
P3
-
6
-
b73
-
generic
-
generic
Doug Lea writes:
Dawid on c-i list (also pasted below) made a reasonable request to add methods
to the WriteLock (not just the outer RRWL) to make them
consistent with ReentrantLock. These would be just one-line
implementations.
>> ReentrantLock has two methods relevant to exclusive locking:
>>
>> boolean isHeldByCurrentThread() int getHoldCount()
>>
>> Analogous two methods can be found in ReentrantReadWriteLock for the write
>> lock:
>>
>> boolean isWriteLockedByCurrentThread() int getWriteHoldCount()
>>
>> But no such thing is directly available in the public inner class
>> ReentrantReadWriteLock.WriteLock. How about adding such two methods, so that
>> the functionality is available to code to which the write lock solely was
>> passed, and not the whole RRWL?
Dawid on c-i list (also pasted below) made a reasonable request to add methods
to the WriteLock (not just the outer RRWL) to make them
consistent with ReentrantLock. These would be just one-line
implementations.
>> ReentrantLock has two methods relevant to exclusive locking:
>>
>> boolean isHeldByCurrentThread() int getHoldCount()
>>
>> Analogous two methods can be found in ReentrantReadWriteLock for the write
>> lock:
>>
>> boolean isWriteLockedByCurrentThread() int getWriteHoldCount()
>>
>> But no such thing is directly available in the public inner class
>> ReentrantReadWriteLock.WriteLock. How about adding such two methods, so that
>> the functionality is available to code to which the write lock solely was
>> passed, and not the whole RRWL?