From 131116013d0e801c806c38e2cd2e4606f0ee85d8 Mon Sep 17 00:00:00 2001 From: TheMode Date: Sat, 26 Mar 2022 12:02:36 +0100 Subject: [PATCH] Event nodes need total order Signed-off-by: TheMode --- src/main/java/net/minestom/server/event/EventNodeImpl.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/net/minestom/server/event/EventNodeImpl.java b/src/main/java/net/minestom/server/event/EventNodeImpl.java index b2d3cef4e..0211fb988 100644 --- a/src/main/java/net/minestom/server/event/EventNodeImpl.java +++ b/src/main/java/net/minestom/server/event/EventNodeImpl.java @@ -7,7 +7,6 @@ import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.lang.invoke.VarHandle; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; @@ -308,7 +307,7 @@ non-sealed class EventNodeImpl implements EventNode { final class Handle implements ListenerHandle { private final Class eventType; private Consumer listener = null; - private boolean updated; + private volatile boolean updated; Handle(Class eventType) { this.eventType = eventType; @@ -332,11 +331,9 @@ non-sealed class EventNodeImpl implements EventNode { void invalidate() { this.updated = false; - VarHandle.releaseFence(); } @Nullable Consumer updatedListener() { - VarHandle.acquireFence(); if (updated) return listener; synchronized (GLOBAL_CHILD_LOCK) { if (updated) return listener;