Uploaded image for project: 'Apache Curator'
  1. Apache Curator
  2. CURATOR-401

Make InterProcessMutex.isOwnedByCurrentThread public

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.12.0
    • 4.0.0
    • Recipes
    • None

    Description

      It is useful in some cases to be able to tell if the current thread holds the lock before calling acquire. I have some components using InterProcessMutex for coordination that are intended to run in different JVMs in production. I'd like to be able to write an integration test that runs them in the same JVM in different threads, and verify that the lock is held by the expected component at certain points in the code.

      Using InterProcessMutex.isAcquiredInThisProcess is not a good replacement in this case, and acquiring/releasing the lock unnecessarily also doesn't seem like a good solution.

      InterProcessMutex already supports this functionality, but the method is package private.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              srdo Stig Rohde Døssing
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: