Synchronize child access

This commit is contained in:
TheMode 2021-08-19 02:53:13 +02:00
parent 1c59186b61
commit 9750e1fe8b

View File

@ -68,8 +68,8 @@ class EventNodeImpl<T extends Event> implements EventNode<T> {
@Override
public <E extends T> @NotNull List<EventNode<E>> findChildren(@NotNull String name, Class<E> eventType) {
if (children.isEmpty()) return Collections.emptyList();
synchronized (GLOBAL_CHILD_LOCK) {
if (children.isEmpty()) return Collections.emptyList();
List<EventNode<E>> result = new ArrayList<>();
for (EventNode<T> child : children) {
if (equals(child, name, eventType)) {