diff --git a/src/java.base/linux/classes/com/alibaba/wisp/engine/WispEventPump.java b/src/java.base/linux/classes/com/alibaba/wisp/engine/WispEventPump.java index 080c6780d8d..9fe726d4764 100644 --- a/src/java.base/linux/classes/com/alibaba/wisp/engine/WispEventPump.java +++ b/src/java.base/linux/classes/com/alibaba/wisp/engine/WispEventPump.java @@ -181,7 +181,11 @@ private void recordTaskByFD(int fd, WispTask task, int events) { if (fd < LOW_FD_BOUND) { getFd2TaskLow(events)[fd] = task; } else { + WispCarrier carrier = WispCarrier.current(); + final boolean isInCritical0 = carrier.isInCritical; + carrier.isInCritical = true; getFd2TaskHigh(events).put(fd, task); + carrier.isInCritical = isInCritical0; } } @@ -192,7 +196,11 @@ private WispTask removeTaskByFD(int fd, int events) { task = fd2TaskLow[fd]; fd2TaskLow[fd] = null; } else { + WispCarrier carrier = WispCarrier.current(); + final boolean isInCritical0 = carrier.isInCritical; + carrier.isInCritical = true; task = getFd2TaskHigh(events).remove(fd); + carrier.isInCritical = isInCritical0; } return task; }