类java.awt.SecondaryLoop源码实例Demo

下面列出了怎么用java.awt.SecondaryLoop的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: netbeans   文件: NbLifecycleManager.java
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;
    }
}
 
源代码2 项目: runelite   文件: SwingUtil.java
/**
 * Run any events currently in the event queue
 */
public static void pumpPendingEvents()
{
	EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();

	if (eq.peekEvent() != null)
	{
		SecondaryLoop l = eq.createSecondaryLoop();
		SwingUtilities.invokeLater(l::exit);
		l.enter();
	}
}
 
 类所在包
 类方法
 同包方法