This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LazyValue<T> implements Supplier<T> { | |
private volatile T value; | |
private final Supplier<T> producer; | |
private final Object lock = new Object(); | |
public LazyValue(Supplier<T> producer) { | |
this.producer = producer; | |
} | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
DRIVE=$1 | |
OP=$2 | |
# Prints usage message and exits with an error | |
usage() { | |
echo "Usage:" |