// Path: core/src/main/java/org/mini2Dx/miniscript/core/util/ReadWritePriorityQueue.java
// public class ReadWritePriorityQueue<E> extends AbstractConcurrentBlockingQueue<E> {
// 
// 	public ReadWritePriorityQueue() {
// 		this(Integer.MAX_VALUE);
// 	}
// 
// 	public ReadWritePriorityQueue(int maxCapacity) {
// 		super(maxCapacity, new PriorityQueue<>());
// 	}
// }


import org.mini2Dx.miniscript.core.util.ReadWritePriorityQueue;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;

		if(scheduledTask != null) {
			scheduledTaskQueue.remove(scheduledTask);
		}

		if(mayInterruptIfRunning) {
			final Thread thread = executingThread.getAndSet(null);
			if(thread != null) {
				thread.interrupt();
			}
		}

		synchronized(monitor) {
			monitor.notifyAll();
		}
		return false;
	}

	@Override
	public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
		while(!done.get() && !cancelled.get()) {
			synchronized(monitor) {
				monitor.wait(unit.toMillis(timeout));
			}
		}
		return null;
	}

	@Override
	public T get() throws InterruptedException, ExecutionException {
// Path: core/src/main/java/org/mini2Dx/miniscript/core/util/ReadWritePriorityQueue.java
// public class ReadWritePriorityQueue<E> extends AbstractConcurrentBlockingQueue<E> {
// 
// 	public ReadWritePriorityQueue() {
// 		this(Integer.MAX_VALUE);
// 	}
// 
// 	public ReadWritePriorityQueue(int maxCapacity) {
// 		super(maxCapacity, new PriorityQueue<>());
// 	}
// }


// Path: core/src/main/java/org/mini2Dx/miniscript/core/threadpool/ScheduledTaskFuture.java
import org.mini2Dx.miniscript.core.util.ReadWritePriorityQueue;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;


		if(scheduledTask != null) {
			scheduledTaskQueue.remove(scheduledTask);
		}

		if(mayInterruptIfRunning) {
			final Thread thread = executingThread.getAndSet(null);
			if(thread != null) {
				thread.interrupt();
			}
		}

		synchronized(monitor) {
			monitor.notifyAll();
		}
		return false;
	}

	@Override
	public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
		while(!done.get() && !cancelled.get()) {
			synchronized(monitor) {
				monitor.wait(unit.toMillis(timeout));
			}
		}
		return null;
	}

	@Override
	public T get() throws InterruptedException, ExecutionException {
		try {