Interface KeyBasedLockFactory<L>

    • Method Detail

      • getLock

        L getLock​(Object key)
        Returns a lock for the specified key. Implementations will normally do the following: when the first thread calls this method with a key, a new lock is created and returned. When a second, third and so on concurrent thread tries to get a lock for the same key, the first lock is returned, thus allowing synchronization based on the key.
        Parameters:
        key - the key associated with the lock
        Returns:
        the lock