LWCToolkit.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:jdk8u_jdk 作者:
/**
 * Checks if there's an active SelectorPerformer corresponding to the invocation's AppContext,
 * adds the invocation to the SelectorPerformer's queue and returns true.
 * Otherwise does nothing and returns false.
 */
public static boolean offer(InvocationEvent invocation) {
    Object source = invocation.getSource();

    SelectorPerformer performer = (source instanceof Component) ?
            getInstance((Component)source) :
            getInstance(Toolkit.getDefaultToolkit().getSystemEventQueue());

    if (performer == null) return false;

    synchronized (performer.invocations) {
        if (!performer.invocations.isEmpty()) {
            performer.invocations.peek().add(invocation);
            return true;
        }
    }
    return false;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号