public function unlock($key, $ownerid, $forceunlock = false) {
        if (array_key_exists($key, $this->locks)) {
            @unlink($this->locks[$key]);
            unset($this->locks[$key]);
            return true;
        } else if ($forceunlock) {
            $lockfile = $this->get_lock_file($key);
            if (file_exists($lockfile)) {
                @unlink($lockfile);
            }
            return true;
        }
        // You cannot unlock a file you didn't lock.
        return false;
    }