Allow to force the execution of the Runnable in a async fashion even if
the IO-Thread is the current Thread
This commit is contained in:
parent
e207af30a3
commit
875d5ce513
@ -287,10 +287,14 @@ abstract class AbstractNioWorker implements Worker {
|
||||
|
||||
@Override
|
||||
public void executeInIoThread(Runnable task) {
|
||||
start();
|
||||
if (Thread.currentThread() == thread) {
|
||||
executeInIoThread(task, false);
|
||||
}
|
||||
|
||||
public void executeInIoThread(Runnable task, boolean alwaysAsync) {
|
||||
if (!alwaysAsync && Thread.currentThread() == thread) {
|
||||
task.run();
|
||||
} else {
|
||||
start();
|
||||
boolean added = eventQueue.offer(task);
|
||||
|
||||
assert added;
|
||||
|
Loading…
Reference in New Issue
Block a user