ServerBootstrap的init()方法中,有这样一段逻辑:
if (handler != null) { pipeline.addLast(handler);}ch.eventLoop().execute(new Runnable() { @Override public void run() { pipeline.addLast(new ServerBootstrapAcceptor( ch, currentChildGroup, currentChildHandler, currentChildOptions, currentChildAttrs)); }});
为什么对ServerBootstrapAcceptor的添加,要放到线程中执行,而不是直接同步添加?
慕移动9481536
相关分类