def main():
    client = RedisClient('localhost', 6379)
    client.delete(key)
    client.set(incr_key, 0)

    for _ in xrange(500):
        fork(take_lock)
        if random.random() > 0.1:
            sleep(random.random() / 10)
    sleep(2)
    assert counter == int(client.get(incr_key)), 'Incr failed!'
    quickstop()
dataset/ETHPy150Open dieseldev/diesel/examples/redis_lock.py/main/original