Package net.minecraft.client.sounds
Class SoundEngineExecutor
java.lang.Object
net.minecraft.util.thread.BlockableEventLoop<Runnable>
net.minecraft.client.sounds.SoundEngineExecutor
- All Implemented Interfaces:
AutoCloseable,Executor,ProfilerMeasured,TaskScheduler<Runnable>
The SoundEngineExecutor class is responsible for executing sound-related tasks in a separate thread.
It extends the BlockableEventLoop class, providing an event loop for managing and executing tasks.
-
Field Summary
FieldsFields inherited from class net.minecraft.util.thread.BlockableEventLoop
BLOCK_TIME_NANOS -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class net.minecraft.util.thread.BlockableEventLoop
doRunTask, dropAllTasks, execute, executeBlocking, executeIfPossible, getPendingTasksCount, isNonRecoverable, isSameThread, managedBlock, name, pollTask, profiledMetrics, runAllTasks, scheduleExecutables, shouldRunAllTasks, submit, submit, submitAsyncMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.util.thread.TaskScheduler
close, scheduleWithResult
-
Field Details
-
thread
-
shutdown
private volatile boolean shutdown
-
-
Constructor Details
-
SoundEngineExecutor
public SoundEngineExecutor()
-
-
Method Details
-
createThread
-
wrapRunnable
Wraps the given runnable task. In this case, the original runnable is returned as-is.- Parameters:
pRunnable- The original runnable task- Returns:
- The wrapped runnable task
-
schedule
- Specified by:
schedulein interfaceTaskScheduler<Runnable>- Overrides:
schedulein classBlockableEventLoop<Runnable>
-
shouldRun
Determines whether the given runnable task should be run or not. It depends on the shutdown state of the SoundEngineExecutor.- Specified by:
shouldRunin classBlockableEventLoop<Runnable>- Parameters:
pRunnable- The runnable task- Returns:
- true if the task should run, false otherwise
-
getRunningThread
- Specified by:
getRunningThreadin classBlockableEventLoop<Runnable>
-
run
private void run() -
waitForTasks
public void waitForTasks()- Overrides:
waitForTasksin classBlockableEventLoop<Runnable>
-
shutDown
public void shutDown() -
startUp
public void startUp()
-