private static Executor asExecutor(NioWorker worker) { WorkerExecutor executor = (WorkerExecutor) CURRENT_WORKER.get(); if (executor == null) { assert isInIoThread(worker) : "Session created from non-I/O thread"; executor = new WorkerExecutor(worker); CURRENT_WORKER.set(executor); } assert executor.worker == worker : "Worker does not match I/O thread"; return executor; }
private static Executor asExecutor(AbstractNioWorker worker) { WorkerExecutor executor = (WorkerExecutor) CURRENT_WORKER.get(); if (executor == null) { assert isInIoThread(worker) : "Session created from non-I/O thread"; executor = new WorkerExecutor(worker); CURRENT_WORKER.set(executor); } assert executor.worker == worker : "Worker does not match I/O thread"; return executor; }