countDownLatch in server shutdown – real example

In Neo, we use a count down latch to block System.exit() until a number of clean-up tasks are completed on several event-handlers. Event handler could run on any thread, but not the shutdown thread. Each clean-up would trigger upon an event, do the clean-up then call countDown() exactly once.

If a clean-up should run twice, then it should call countDown() exactly twice.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s