Skip to content

Commit 3e5216f

Browse files
authored
Fix concurrency problem. (#15210)
1 parent 91b005e commit 3e5216f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/ThreadlessExecutor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,9 @@ private static void throwIfInterrupted() throws InterruptedException {
9595
public void execute(Runnable runnable) {
9696
RunnableWrapper run = new RunnableWrapper(runnable);
9797
queue.add(run);
98-
if (waiter.get() != SHUTDOWN) {
99-
LockSupport.unpark((Thread) waiter.get());
98+
Object waiter = this.waiter.get();
99+
if (waiter != SHUTDOWN) {
100+
LockSupport.unpark((Thread) waiter);
100101
} else if (queue.remove(run)) {
101102
throw new RejectedExecutionException();
102103
}

0 commit comments

Comments
 (0)