Java Code Examples for java.awt.SecondaryLoop

The following are top voted examples for showing how to use java.awt.SecondaryLoop. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: incubator-netbeans   File: NbLifecycleManager.java   View source code 6 votes vote down vote up
private boolean blockForExit(CountDownLatch[] arr) {
    synchronized (NbLifecycleManager.class) {
        if (onExit != null) {
            arr[0] = onExit;
            LOG.log(Level.FINE, "blockForExit, already counting down {0}", onExit);
            return true;
        }
        arr[0] = onExit = new CountDownLatch(1) {
            @Override
            public void countDown() {
                super.countDown();
                SecondaryLoop d = sndLoop;
                LOG.log(Level.FINE, "countDown for {0}, hiding {1}, by {2}",
                    new Object[] { this, d, Thread.currentThread() }
                );
                if (d != null) {
                    while (!d.exit()) {
                        LOG.log(Level.FINE, "exit before enter, try again");
                    }
                }
            }
        };
        LOG.log(Level.FINE, "blockForExit, new {0}", onExit);
        return false;
    }
}