Skip to content

Instantly share code, notes, and snippets.

@grkvlt
Created October 12, 2017 15:06
Show Gist options
  • Save grkvlt/2a62a53bc6912c0d4e5bad730a09d2d7 to your computer and use it in GitHub Desktop.
Save grkvlt/2a62a53bc6912c0d4e5bad730a09d2d7 to your computer and use it in GitHub Desktop.
Exploring Iterated Function Systems
public Runnable task(AtomicBoolean cancel, Runnable task) {
return () -> {
while (latch.get()); // Wait until latch released
long initial = token.get();
do {
task.run();
} while (!cancel.get() && token.get() == initial);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment