Package net.minecraft.util.thread
Class ProcessorMailbox<T>
java.lang.Object
net.minecraft.util.thread.ProcessorMailbox<T>
- All Implemented Interfaces:
AutoCloseable
,Runnable
,ProfilerMeasured
,ProcessorHandle<T>
public class ProcessorMailbox<T>
extends Object
implements ProfilerMeasured, ProcessorHandle<T>, AutoCloseable, Runnable
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
private final Executor
private static final org.slf4j.Logger
private final String
private final StrictQueue<? super T,
? extends Runnable> private static final int
private final AtomicInteger
-
Constructor Summary
ConstructorDescriptionProcessorMailbox
(StrictQueue<? super T, ? extends Runnable> p_18741_, Executor p_18742_, String p_18743_) -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
void
close()
static ProcessorMailbox<Runnable>
boolean
hasWork()
name()
private boolean
pollTask()
private int
pollUntil
(it.unimi.dsi.fastutil.ints.Int2BooleanFunction p_18748_) private void
void
run()
void
runAll()
private void
private boolean
private boolean
int
size()
void
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.util.thread.ProcessorHandle
ask, askEither
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
CLOSED_BIT
private static final int CLOSED_BIT- See Also:
-
SCHEDULED_BIT
private static final int SCHEDULED_BIT- See Also:
-
status
-
queue
-
dispatcher
-
name
-
-
Constructor Details
-
ProcessorMailbox
public ProcessorMailbox(StrictQueue<? super T, ? extends Runnable> p_18741_, Executor p_18742_, String p_18743_)
-
-
Method Details
-
create
-
setAsScheduled
private boolean setAsScheduled() -
setAsIdle
private void setAsIdle() -
canBeScheduled
private boolean canBeScheduled() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceProcessorHandle<T>
-
shouldProcess
private boolean shouldProcess() -
pollTask
private boolean pollTask() -
run
public void run() -
runAll
public void runAll() -
tell
- Specified by:
tell
in interfaceProcessorHandle<T>
-
registerForExecution
private void registerForExecution() -
pollUntil
private int pollUntil(it.unimi.dsi.fastutil.ints.Int2BooleanFunction p_18748_) -
size
public int size() -
hasWork
public boolean hasWork() -
toString
-
name
- Specified by:
name
in interfaceProcessorHandle<T>
-
profiledMetrics
- Specified by:
profiledMetrics
in interfaceProfilerMeasured
-