Skip to content

Instantly share code, notes, and snippets.

@ljnelson
Last active February 20, 2017 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljnelson/dd5d23e4ab1fb3e128588978c5e2bcdf to your computer and use it in GitHub Desktop.
Save ljnelson/dd5d23e4ab1fb3e128588978c5e2bcdf to your computer and use it in GitHub Desktop.
private final CountDownLatch latch;
private final Collection<HttpServer> startedHttpServers;
public HttpServerStartingExtension() {
super();
this.startedHttpServers = new LinkedList<>();
this.latch = new CountDownLatch(1);
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
latch.countDown();
}));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment