summaryrefslogtreecommitdiff
path: root/main/client/src/Lock.java
blob: 6e5f18b0bef9e356e98d0a0ad12e23253211247e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package mill.main.client;
public abstract class Lock implements AutoCloseable{
    abstract public Locked lock() throws Exception;
    abstract public Locked tryLock() throws Exception;

    public void await() throws Exception{
        lock().release();
    }

    /**
     * Returns `true` if the lock is *available for taking*
     */
    abstract public boolean probe() throws Exception;
}