def free_lock(id):
    try:
        filename = _lock_file(id)
        # On POSIX systems os.rename is an atomic operation, so this is the safe
        # way to delete a lock:
        os.rename(filename, filename + '.redundant')
        os.remove(filename + '.redundant')
        return True
    except:
        return False
Attempts to free lock id, returning success as True/False.
dataset/ETHPy150Open nitishsrivastava/deepnet/cudamat/gpu_lock2.py/free_lock