More methods for ReentrantReadWriteLock.WriteLock

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P3
    • 6
    • Affects Version/s: 6
    • Component/s: core-libs

      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?

            Assignee:
            Martin Buchholz
            Reporter:
            Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: