unlock

@param key
@param request request must be the same as lock request
@return
339138
public boolean unlock(String key, String request) {

        //get connection
        Object connection = getConnection();
        //lua script

        Object result = null;
        if (connection instanceof Jedis) {
            result = ((Jedis) connection).eval(script, Collections.singletonList(lockPrefix + key), Collections.singletonList(request));
            ((Jedis) connection).close();
        } else if (connection instanceof JedisCluster) {
            result = ((JedisCluster) connection).eval(script, Collections.singletonList(lockPrefix + key), Collections.singletonList(request));

        } else {
            //throw new RuntimeException("instance is error") ;
            return false;
        }

        if (UNLOCK_MSG.equals(result)) {
            return true;
        } else {
            return false;
        }
    }
951480
private static Object getLockObject(Object key) {
    int hc = key.hashCode();
    return KEY_LOCKS[hc & KEY_LOCKS_MASK];
  }
99291
static public String generateKey(HttpServletRequest request, Iterable<ICacheKeyGenerator> keyGens) {
		StringBuffer sb = new StringBuffer();
		for (ICacheKeyGenerator keyGen : keyGens) {
			String key = keyGen.generateKey(request);
			if (key != null && key.length() > 0) {
				sb.append(sb.length() > 0 ? ";" : "").append(key); //$NON-NLS-1$ //$NON-NLS-2$
			}
		}
		return sb.toString();
	}
24839
public static boolean checkSelector(SlingHttpServletRequest request, String key) {
        String[] selectors = request.getRequestPathInfo().getSelectors();
        for (String selector : selectors) {
            if (selector.equals(key)) {
                return true;
            }
        }
        return false;
    }
810392
@NonNull
    @Override
    public MutableDictionary remove(@NonNull String key) {
        if (key == null) { throw new IllegalArgumentException("key cannot be null."); }

        synchronized (lock) {
            internalDict.remove(key);
            return this;
        }
    }
163613
def is_locked(self, request: AxesHttpRequest, credentials: dict = None) -> bool:
        

        if settings.AXES_LOCK_OUT_AT_FAILURE:
            return self.get_failures(request, credentials) >= settings.AXES_FAILURE_LIMIT

        return False
1170078
private static BinaryMemcacheRequest handleUnlockRequest(final UnlockRequest msg) {
        byte[] key = msg.keyBytes();
        short keyLength = (short) key.length;
        BinaryMemcacheRequest request = new DefaultBinaryMemcacheRequest(key);
        request.setOpcode(OP_UNLOCK);
        request.setKeyLength(keyLength);
        request.setTotalBodyLength(keyLength);
        request.setCAS(msg.cas());
        return request;
    }
790178
protected Queue<AsyncResourceRequest<V>> getRequestQueueForKey(K key) {
        Queue<AsyncResourceRequest<V>> requestQueue = requestQueueMap.get(key);
        if(requestQueue == null) {
            Queue<AsyncResourceRequest<V>> newRequestQueue = new ConcurrentLinkedQueue<AsyncResourceRequest<V>>();
            requestQueue = requestQueueMap.putIfAbsent(key, newRequestQueue);
            if(requestQueue == null) {
                requestQueue = newRequestQueue;
            }
        }
        return requestQueue;
    }
381049
@Override
    public void unlock(EJSContainer c, Object lockName, Locker locker)
    {
        c.getLockManager().unlock(lockName, locker);
    }
143420
public static void removeToken(final HttpServletRequest request, final String key) {
		request.getSession(true).removeAttribute(key);
	}
707429
public static Lock getLock(String key) {
        Lock lock = container.get(key);
        if (lock == null) {
            synchronized (container) {
                lock = container.computeIfAbsent(key, k -> new ReentrantLock());
            }
        }
        return lock;
    }
715609
public T get(String key) {
        rlock.lock();
        try {
            return map.get(key);
        } finally {
            rlock.unlock();
        }
    }
259270
public void removeRequestProp(String key) {
        if (key == null) {
            return;
        }
        if (requestProps != null) {
            requestProps.remove(key);
        }
    }
273267
public static UIContext getContext(final String key, final Request request) {
		return (UIContext) request.getSessionAttribute(DATA_LIST_UIC_SESSION_KEY);
	}
1153051
public boolean unlock(KeyColumn kc, T requestor) {

        if (!locks.containsKey(kc)) {
            log.info("Local unlock failed: no locks found for {}", kc);
            return false;
        }

        AuditRecord<T> unlocker = new AuditRecord<>(requestor, null);

        AuditRecord<T> holder = locks.get(kc);

        if (!holder.equals(unlocker)) {
            log.error("Local unlock of {} by {} failed: it is held by {}",
                    kc, unlocker, holder);
            return false;
        }

        boolean removed = locks.remove(kc, unlocker);

        if (removed) {
            expiryQueue.remove(kc);
            if (log.isTraceEnabled()) {
                log.trace("Local unlock succeeded: {} namespace={} txn={}",
                        kc, name, requestor);
            }
        } else {
            log.warn("Local unlock warning: lock record for {} disappeared "
                + "during removal; this suggests the lock either expired "
                + "while we were removing it, or that it was erroneously "
                + "unlocked multiple times.", kc);
        }

        // Even if !removed, we're finished unlocking, so return true
        return true;
    }
1282002
protected String getLockProperty(String key) {
        return lockProps != null ? lockProps.getProperty(key) : null;
    }
782560
public Optional<LockResource> tryGet(K key, LockMode mode) {
    ValNode valNode = getValNode(key);
    ReentrantReadWriteLock lock = valNode.mValue;
    Lock innerLock;
    switch (mode) {
      case READ:
        innerLock = lock.readLock();
        break;
      case WRITE:
        innerLock = lock.writeLock();
        break;
      default:
        throw new IllegalStateException("Unknown lock mode: " + mode);
    }
    if (!innerLock.tryLock()) {
      return Optional.empty();
    }
    return Optional.of(new RefCountLockResource(innerLock, false, valNode.mRefCount));
  }