'Release this lock.
This deletes the directory with the given name.
@raise: Any exception os.readlink() may raise, or
ValueError if the lock is not owned by this process.'

def unlock(self):

    pid = readlink(self.name)
    if (int(pid) != os.getpid()):
        raise ValueError(('Lock    %r    not    owned    by    this    process' % (self.name,)))
    rmlink(self.name)
    self.locked = False
