package edu.nyu.cs9053.concurrency.mutex;

import edu.nyu.cs9053.concurrency.Concurrent;

import java.util.concurrent.Callable;

/**
 * User: blangel
 * Date: 11/9/14
 * Time: 2:55 PM
 */
public class MutexExample {

    public static void main(String[] args) throws Exception {
        final UniqueNumberGenerator generator = new UniqueNumberGenerator();
        Callable<Long> logic = new Callable<Long>() {
            @Override public Long call() throws Exception {
                return generator.next();
            }
        };
        Concurrent.run(logic, 2);
    }

}
