Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6378321

More methods for ReentrantReadWriteLock.WriteLock

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 6
    • 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?

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: