private void setTaskFailure(Exception e) {
            synchronized (taskMonitor) {
                if (taskException == null) {
                    taskException = e;
                } else {
                    System.out.println("Got subsequent exception in task execution: ");
                    e.printStackTrace();
                }
            }
        }
Wrapper around CountDownLatch for single-occurrence events.
jdisc_core/src/main/java/com/yahoo/jdisc/test/ServerProviderConformanceTest.java