Write-lock key and delete; blocking.
Throws IAE if the key is already locked.
166738
public static void delete( Key key ) { 
    Value val = DKV.get(key);
    if( val==null ) return;
    ((Lockable)val.get()).delete();
  }
870986
def remove_lock(lock, key, session=None):
    
    return _request('get', '/remove/lock/{0}'.format(lock), params={'key': key}, session=session)
435771
def unload_key(self, key):
        
        self.sync()
        return super(DeferredWriteBucket, self).unload_key(key)
699166
public V remove(K key) throws Exception {
        return invoke(REMOVE, key, null, true);
    }
676089
def delete(self, key):
        
        with self._lmdb.begin(write=True, buffers=True) as txn:
            txn.delete(key.encode())
479175
public void removeWriter(LockEntry writer)
    {
        checkTimedOutLocks();

        String oidString = writer.getOidString();
        ObjectLocks objectLocks = null;
        synchronized (locktable)
        {
        	objectLocks = (ObjectLocks) locktable.get(oidString);
        }
        if (objectLocks == null)
        {
            return;
        }
        else
        {
			/**
        	 * MBAIRD, last one out, close the door and turn off the lights.
        	 * if no locks (readers or writers) exist for this object, let's remove
        	 * it from the locktable.
        	 */
        	synchronized (locktable)
        	{
        		Map readers = objectLocks.getReaders();
        		objectLocks.setWriter(null);
        		// no need to check if writer is null, we just set it.
            	if (readers.size() == 0)
            	{
            		locktable.remove(oidString);
            	}
        	}
        }
    }
1295659
public static boolean tryLock(String key, int wait) throws InterruptedException {
        return getLock(key).tryLock(wait, TimeUnit.MILLISECONDS);
    }
584337
def clear!(*args)
      internal_lock do
        args = registry.keys if args.empty?
        args.each do |key|
          value = self[key]
          if value.respond_to?(:clear)
            value.clear
          elsif value.respond_to?(:value)
            value.value = nil
          end
          registry.delete(key)
        end
        yield if block_given?
      end
      true
    end
1292594
@Override
  public void removeFailure(K key, StoreAccessException e) {
    try {
      loaderWriter.delete(key);
    } catch(Exception e1) {
      throw ExceptionFactory.newCacheWritingException(e1, e);
    } finally {
      cleanup(key, e);
    }
  }
1335611
private final void contendedLock() {
            boolean waiting = false;
            for (int s;;) {
                if (((s = lockState) & ~WAITER) == 0) {
                    if (U.compareAndSwapInt(this, LOCKSTATE, s, WRITER)) {
                        if (waiting)
                            waiter = null;
                        return;
                    }
                }
                else if ((s & WAITER) == 0) {
                    if (U.compareAndSwapInt(this, LOCKSTATE, s, s | WAITER)) {
                        waiting = true;
                        waiter = Thread.currentThread();
                    }
                }
                else if (waiting)
                    LockSupport.park(this);
            }
        }
1063560
void unlockBucketsWrite(long i1, long i2) {
		int bucket1LockIdx = getBucketLock(i1);
		int bucket2LockIdx = getBucketLock(i2);
		// always unlock segments in same order to avoid deadlocks
		if (bucket1LockIdx == bucket2LockIdx) {
			lockAry[bucket1LockIdx].tryUnlockWrite();
			return;
		}
		lockAry[bucket1LockIdx].tryUnlockWrite();
		lockAry[bucket2LockIdx].tryUnlockWrite();
	}
192736
def delete_variable(self, key):
        
        key = str(key)
        if self.is_locked(key):
            raise RuntimeError("Global variable is locked")

        with self.__global_lock:
            if key in self.__global_variable_dictionary:
                access_key = self.lock_variable(key, block=True)
                del self.__global_variable_dictionary[key]
                self.unlock_variable(key, access_key)
                del self.__variable_locks[key]
                del self.__variable_references[key]
            else:
                raise AttributeError("Global variable %s does not exist!" % str(key))

        logger.debug("Global variable %s was deleted!" % str(key))
520015
public void lock(String key, String request) throws InterruptedException {
        //get connection
        Object connection = getConnection();
        String result ;
        for (; ;) {
            if (connection instanceof Jedis){
                result = ((Jedis)connection).set(lockPrefix + key, request, SET_IF_NOT_EXIST, SET_WITH_EXPIRE_TIME, 10 * TIME);
                if (LOCK_MSG.equals(result)){
                    ((Jedis) connection).close();
                }
            }else {
                result = ((JedisCluster)connection).set(lockPrefix + key, request, SET_IF_NOT_EXIST, SET_WITH_EXPIRE_TIME, 10 * TIME);
            }

            if (LOCK_MSG.equals(result)) {
                break;
            }

            Thread.sleep(sleepTime);
        }

    }
1151441
public void delete(String key) {
        if (!ramMode.equals(DualCacheRamMode.DISABLE)) {
            ramCacheLru.remove(key);
        }
        if (!diskMode.equals(DualCacheDiskMode.DISABLE)) {
            try {
                dualCacheLock.lockDiskEntryWrite(key);
                diskLruCache.remove(key);
            } catch (IOException e) {
                logger.logError(e);
            } finally {
                dualCacheLock.unLockDiskEntryWrite(key);
            }
        }
    }
718365
public synchronized boolean remove(String key) throws IOException {
		checkNotClosed();
		validateKey(key);
		Entry entry = lruEntries.get(key);
		if (entry == null || entry.currentEditor != null) {
			return false;
		}

		for (int i = 0; i < valueCount; i++) {
			File file = entry.getCleanFile(i);
			if (file.exists() && !file.delete()) {
				throw new IOException("failed to delete " + file);
			}
			size -= entry.lengths[i];
			fileCount--;
			entry.lengths[i] = 0;
		}

		redundantOpCount++;
		journalWriter.append(REMOVE + ' ' + key + '\n');
		lruEntries.remove(key);

		if (journalRebuildRequired()) {
			executorService.submit(cleanupCallable);
		}

		return true;
	}
60181
public final void deleteWithNoReply(final String key, final int time)
      throws InterruptedException, MemcachedException {
    try {
      this.delete0(key, time, 0, true, this.opTimeout);
    } catch (TimeoutException e) {
      throw new MemcachedException(e);
    }
  }
518542
@Override
    public void drop(T key) {
        if (emulateIsAbsent)
            lock.writeLock().lock();

        compressedEntries.remove(key);

        if (emulateIsAbsent)
            lock.writeLock().unlock();
    }