Class HashMapLocks

java.lang.Object
com.mapr.baseutils.utils.HashMapLocks

public class HashMapLocks extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    lock(int id)
     
    boolean
    tryLock(int id)
    Attempts to obtain the lock of the object corresponding to the argument.
    void
    unlock(int id)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
  • Constructor Details

    • HashMapLocks

      public HashMapLocks()
  • Method Details

    • lock

      public void lock(int id)
    • tryLock

      public boolean tryLock(int id)
      Attempts to obtain the lock of the object corresponding to the argument. Returns 'true' if the lock could be taken or 'false' otherwise
      Parameters:
      id -
      Returns:
      'true' if the lock could be taken or 'false' otherwise
    • unlock

      public void unlock(int id)