Erase the lock file. It's essentially a forced unlock method.
169516
def forced_unlock
      @file = nil
      if File.exist?(@file_name)
        begin
          File.delete(@file_name)
          PEROBS.log.debug "Lock file #{@file_name} has been deleted."
        rescue IOError => e
          PEROBS.log.error "Cannot delete lock file #{@file_name}: " +
            e.message
        end
      end
    end
1205110
public function clear() {
		$fileEngine = $this->getFileEngine();
		$fileEngine->removeAll();
		if (!$this->tm->hasOpenTransaction()) {
			$fileEngine->flush();
		}
	}
1179545
void unlock(Path lockFile) throws JobLockException {
    log.debug("Removing lock: {}", lockFile);
    if (!isLocked(lockFile)) {
      return;
    }

    try {
      this.fs.delete(lockFile, false);
    } catch (IOException e) {
      throw new JobLockException(e);
    }
  }
347393
private boolean cleanLockedObjects( LockedObject lo,
                                        boolean temporary ) {

        if (lo.children == null) {
            if (lo.owner == null) {
                if (temporary) {
                    lo.removeTempLockedObject();
                } else {
                    lo.removeLockedObject();
                }

                return true;
            }
            return false;
        }
        boolean canDelete = true;
        int limit = lo.children.length;
        for (int i = 0; i < limit; i++) {
            if (!cleanLockedObjects(lo.children[i], temporary)) {
                canDelete = false;
            } else {

                // because the deleting shifts the array
                i--;
                limit--;
            }
        }
        if (canDelete) {
            if (lo.owner == null) {
                if (temporary) {
                    lo.removeTempLockedObject();
                } else {
                    lo.removeLockedObject();
                }
                return true;
            }
            return false;
        }
        return false;
    }
870986
def remove_lock(lock, key, session=None):
    
    return _request('get', '/remove/lock/{0}'.format(lock), params={'key': key}, session=session)
1347117
void purge() {

        uncommittedCache.clear();

        try {
            if (cacheReadonly) {
                close(false);
            } else {
                if (dataFile != null) {
                    dataFile.close();

                    dataFile = null;
                }

                FileUtil.getDefaultInstance().delete(fileName);
            }
        } catch (Exception e) {
            throw Error.error(ErrorCode.FILE_IO_ERROR,
                              ErrorCode.M_TextCache_purging_file_error,
                              new Object[] {
                fileName, e
            });
        }
    }
825575
public function free()
    {
        if ($this->locked) {
            $this->unlock();
        }
        $this->content = null;
        $this->raw = null;

        unset(static::$instances[$this->filename]);
    }
878424
public void unlock() {

        for (Locale l : m_lockedBundleFiles.keySet()) {
            LockedFile f = m_lockedBundleFiles.get(l);
            f.tryUnlock();
        }
        if (null != m_descFile) {
            m_descFile.tryUnlock();
        }
    }
479004
def unlocked_release(id)
      lock_file = @machine_locks[id]
      if lock_file
        lock_file.close
        begin
          File.delete(lock_file.path)
        rescue Errno::EACCES
          # Another process is probably opened it, no problem.
        end

        @machine_locks.delete(id)
      end
    end
964960
def release(self):
        
        if self._lock_fd is not None:
            os.close(self._lock_fd)
            try:
                os.remove(self._lock_filename)
            except OSError:
                # Hmm, someone deleted our lock while we had it locked?
                # Nothing we can do, so just continue
                pass
50698
public function unlock()
    {
        $this->checkDirExists();

        $pidFile = $this->directory.$this->filename;
        if (!file_exists($pidFile)) {
            return false;
        }

        if (!is_writable($pidFile)) {
            throw new \Exception('Can not write to file: '.$pidFile);
        }

        return unlink($pidFile);
    }
326052
def _unlock(self, closing=False):
        
        # write("_unlock", closing)
        try:
            if self.cur_dir != self.root_dir:
                if closing:
                    write(
                        "Changing to ftp root folder to remove lock file: {}".format(
                            self.root_dir
                        )
                    )
                    self.cwd(self.root_dir)
                else:
                    write_error(
                        "Could not remove lock file, because CWD != ftp root: {}".format(
                            self.cur_dir
                        )
                    )
                    return

            if self.lock_data is False:
                if self.get_option("verbose", 3) >= 4:
                    write("Skip remove lock file (was not written).")
            else:
                # direct delete, without updating metadata or checking for target access:
                try:
                    self.ftp.delete(DirMetadata.LOCK_FILE_NAME)
                    # self.remove_file(DirMetadata.LOCK_FILE_NAME)
                except Exception as e:
                    # I have seen '226 Closing data connection' responses here,
                    # probably when a previous command threw another error.
                    # However here, 2xx response should be Ok(?):
                    # A 226 reply code is sent by the server before closing the
                    # data connection after successfully processing the previous client command
                    if e.args[0][:3] == "226":
                        write_error("Ignoring 226 response for ftp.delete() lockfile")
                    else:
                        raise

            self.lock_data = None
        except Exception as e:
            write_error("Could not remove lock file: {}".format(e))
            raise
435790
private boolean releaseFileLock() {

        // Note:  Closing the super class RandomAccessFile has the
        //        side-effect of closing the file lock's FileChannel,
        //        so we do not deal with this here.
        boolean success = false;

        if (this.fileLock == null) {
            success = true;
        } else {
            try {
                this.fileLock.release();

                success = true;
            } catch (Exception e) {}
            finally {
                this.fileLock = null;
            }
        }

        return success;
    }
560862
private void clearLock() {
      Object previousValue = noCacheStoreCache.remove(keyOfLock);
      if (previousValue!=null && trace) {
         log.tracef("Lock removed for index: %s", indexName);
      }
   }
1011333
public void release() throws IOException {
    lockFileStream.close();
    if(!fs.delete(lockFile, false)) {
      LOG.warn("Unable to delete lock file, Spout = {}", componentID);
      throw new IOException("Unable to delete lock file");
    }
    LOG.debug("Released lock file {}. Spout {}", lockFile, componentID);
  }
1194544
public void clear() {
		domainsFileLock.writeLock().lock();
		logger.trace("LOCK writelock");
		allDomains = null;
		domainMap = null;
		logger.trace("UNLOCK writelock");
		domainsFileLock.writeLock().unlock();
	}
520709
function unlock()
    {
        if ( $fp = $this->fp() )
        {
            fclose( $fp );
            @unlink( $this->MetaFileName );
            @unlink( $this->FileName );
            $GLOBALS['eZMutex_FP_' . $this->FileName] = false;
        }
        return false;
    }