Skip to content

Package net.minecraft.util.thread

Part 1/1


AbstractConsecutiveExecutor

  • Full name: net.minecraft.util.thread.AbstractConsecutiveExecutor
  • Package: net.minecraft.util.thread
  • Source: commonnet/minecraft/util/thread/AbstractConsecutiveExecutor.java
  • Type: class
  • Modifiers: public abstract
  • Implements: ProfilerMeasured,TaskScheduler<T>,Runnable

net.minecraft.util.thread.AbstractConsecutiveExecutor#AbstractConsecutiveExecutor(StrictQueue<T>,Executor,String)

  • Origin: common
  • Source: net/minecraft/util/thread/AbstractConsecutiveExecutor.java:23
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ AbstractConsecutiveExecutor ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: executor, queue, name. เรียกต่อ: add().

Parameters

  • StrictQueue<T> strictQueue
  • Executor executor
  • String string

ตัวอย่างใช้งาน

StrictQueue<T> strictQueue = ...;
Executor executor = ...;
AbstractConsecutiveExecutor instance = new AbstractConsecutiveExecutor(strictQueue, executor, "value");

net.minecraft.util.thread.AbstractConsecutiveExecutor#close()

  • Origin: common
  • Source: net/minecraft/util/thread/AbstractConsecutiveExecutor.java:34
  • Modifiers: public
  • Return: void

คืออะไร

ปิด close

ทำงานยังไง

เรียกต่อ: set().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

AbstractConsecutiveExecutor instance = ...;
instance.close();

net.minecraft.util.thread.AbstractConsecutiveExecutor#hasWork()

  • Origin: common
  • Source: net/minecraft/util/thread/AbstractConsecutiveExecutor.java:97
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบว่ามี Work

ทำงานยังไง

เรียกต่อ: isRunning(), isEmpty(). คืนค่า: this.isRunning() && !this.queue.isEmpty().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

AbstractConsecutiveExecutor instance = ...;
boolean result = instance.hasWork();

net.minecraft.util.thread.AbstractConsecutiveExecutor#name()

  • Origin: common
  • Source: net/minecraft/util/thread/AbstractConsecutiveExecutor.java:106
  • Modifiers: public
  • Return: String

คืออะไร

ดำเนินการ name ตาม implementation ของ AbstractConsecutiveExecutor

ทำงานยังไง

คืนค่า: this.name.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

AbstractConsecutiveExecutor instance = ...;
String result = instance.name();

net.minecraft.util.thread.AbstractConsecutiveExecutor#profiledMetrics()

  • Origin: common
  • Source: net/minecraft/util/thread/AbstractConsecutiveExecutor.java:111
  • Modifiers: public
  • Return: List<MetricSampler>

คืออะไร

ดำเนินการ profiledMetrics ตาม implementation ของ AbstractConsecutiveExecutor

ทำงานยังไง

เรียกต่อ: of(), create(). คืนค่า: ImmutableList.of(MetricSampler.create(this.name + "-queue-size", MetricCategory.CONSECUTIVE_EXECUTORS, this::size)).

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

AbstractConsecutiveExecutor instance = ...;
List<MetricSampler> result = instance.profiledMetrics();

net.minecraft.util.thread.AbstractConsecutiveExecutor#run()

  • Origin: common
  • Source: net/minecraft/util/thread/AbstractConsecutiveExecutor.java:53
  • Modifiers: public
  • Return: void

คืออะไร

สั่งทำงาน run

ทำงานยังไง

มีการจัดการ exception. เรียกต่อ: pollTask(), setSleeping(), registerForExecution().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

AbstractConsecutiveExecutor instance = ...;
instance.run();

net.minecraft.util.thread.AbstractConsecutiveExecutor#runAll()

  • Origin: common
  • Source: net/minecraft/util/thread/AbstractConsecutiveExecutor.java:63
  • Modifiers: public
  • Return: void

คืออะไร

สั่งทำงาน All

ทำงานยังไง

มีการวนลูป ; มีการจัดการ exception. เรียกต่อ: pollTask(), setSleeping(), registerForExecution().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

AbstractConsecutiveExecutor instance = ...;
instance.runAll();

net.minecraft.util.thread.AbstractConsecutiveExecutor#schedule(T)

  • Origin: common
  • Source: net/minecraft/util/thread/AbstractConsecutiveExecutor.java:73
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ schedule ตาม implementation ของ AbstractConsecutiveExecutor

ทำงานยังไง

เรียกต่อ: push(), registerForExecution().

Parameters

  • T runnable

ตัวอย่างใช้งาน

AbstractConsecutiveExecutor instance = ...;
T runnable = ...;
instance.schedule(runnable);

net.minecraft.util.thread.AbstractConsecutiveExecutor#size()

  • Origin: common
  • Source: net/minecraft/util/thread/AbstractConsecutiveExecutor.java:93
  • Modifiers: public
  • Return: int

คืออะไร

ดำเนินการ size ตาม implementation ของ AbstractConsecutiveExecutor

ทำงานยังไง

คืนค่า: this.queue.size().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

AbstractConsecutiveExecutor instance = ...;
int result = instance.size();

net.minecraft.util.thread.AbstractConsecutiveExecutor#toString()

  • Origin: common
  • Source: net/minecraft/util/thread/AbstractConsecutiveExecutor.java:101
  • Modifiers: public
  • Return: String

คืออะไร

ดำเนินการ toString ตาม implementation ของ AbstractConsecutiveExecutor

ทำงานยังไง

เรียกต่อ: get(), isEmpty(). คืนค่า: this.name + " " + this.status.get() + " " + this.queue.isEmpty().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

AbstractConsecutiveExecutor instance = ...;
String result = instance.toString();

BlockableEventLoop

  • Full name: net.minecraft.util.thread.BlockableEventLoop
  • Package: net.minecraft.util.thread
  • Source: commonnet/minecraft/util/thread/BlockableEventLoop.java
  • Type: class
  • Modifiers: public abstract
  • Implements: ProfilerMeasured,TaskScheduler<R>,Executor

net.minecraft.util.thread.BlockableEventLoop#BlockableEventLoop(String)

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:31
  • Modifiers: protected
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ BlockableEventLoop ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: name. เรียกต่อ: add().

Parameters

  • String string

ตัวอย่างใช้งาน

BlockableEventLoop instance = new BlockableEventLoop("value");

net.minecraft.util.thread.BlockableEventLoop#doRunTask(R)

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:147
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doRunTask ตาม implementation ของ BlockableEventLoop

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการจัดการ exception. เรียกต่อ: beginZone(), run(), error(), name(), isNonRecoverable().

Parameters

  • R runnable

ตัวอย่างใช้งาน

R runnable = ...;
@Override
protected void doRunTask(R runnable) {
    super.doRunTask(runnable);
}

net.minecraft.util.thread.BlockableEventLoop#dropAllTasks()

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:105
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ dropAllTasks ตาม implementation ของ BlockableEventLoop

ทำงานยังไง

เรียกต่อ: clear().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

@Override
protected void dropAllTasks() {
    super.dropAllTasks();
}

net.minecraft.util.thread.BlockableEventLoop#execute(Runnable)

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:92
  • Modifiers: public
  • Return: void

คืออะไร

สั่งทำงาน execute

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: scheduleExecutables(), schedule(), wrapRunnable(), run().

Parameters

  • Runnable runnable

ตัวอย่างใช้งาน

BlockableEventLoop instance = ...;
Runnable runnable = ...;
instance.execute(runnable);

net.minecraft.util.thread.BlockableEventLoop#executeBlocking(Runnable)

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:78
  • Modifiers: public
  • Return: void

คืออะไร

สั่งทำงาน Blocking

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: isSameThread(), submitAsync(), join(), run().

Parameters

  • Runnable runnable

ตัวอย่างใช้งาน

BlockableEventLoop instance = ...;
Runnable runnable = ...;
instance.executeBlocking(runnable);

net.minecraft.util.thread.BlockableEventLoop#executeIfPossible(Runnable)

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:101
  • Modifiers: public
  • Return: void

คืออะไร

สั่งทำงาน If Possible

ทำงานยังไง

เรียกต่อ: execute().

Parameters

  • Runnable runnable

ตัวอย่างใช้งาน

BlockableEventLoop instance = ...;
Runnable runnable = ...;
instance.executeIfPossible(runnable);

net.minecraft.util.thread.BlockableEventLoop#getPendingTasksCount()

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:48
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Pending Tasks Count

ทำงานยังไง

เรียกต่อ: size(). คืนค่า: this.pendingRunnables.size().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

BlockableEventLoop instance = ...;
int result = instance.getPendingTasksCount();

net.minecraft.util.thread.BlockableEventLoop#getRunningThread()

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:42
  • Modifiers: protected abstract
  • Return: Thread

คืออะไร

อ่านค่า Running Thread

ทำงานยังไง

ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

@Override
protected Thread getRunningThread() {
    return super.getRunningThread();
}

net.minecraft.util.thread.BlockableEventLoop#isNonRecoverable(Throwable)

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:163
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Non Recoverable

ทำงานยังไง

เรียกต่อ: getCause().

Parameters

  • Throwable throwable

ตัวอย่างใช้งาน

Throwable throwable = ...;
boolean result = BlockableEventLoop.isNonRecoverable(throwable);

net.minecraft.util.thread.BlockableEventLoop#isSameThread()

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:38
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Same Thread

ทำงานยังไง

เรียกต่อ: currentThread(), getRunningThread(). คืนค่า: Thread.currentThread() == this.getRunningThread().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

BlockableEventLoop instance = ...;
boolean result = instance.isSameThread();

net.minecraft.util.thread.BlockableEventLoop#managedBlock(BooleanSupplier)

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:128
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ managedBlock ตาม implementation ของ BlockableEventLoop

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป ; มีการจัดการ exception. แก้ state: blockingCount. เรียกต่อ: getAsBoolean(), pollTask(), waitForTasks().

Parameters

  • BooleanSupplier booleanSupplier

ตัวอย่างใช้งาน

BlockableEventLoop instance = ...;
BooleanSupplier booleanSupplier = ...;
instance.managedBlock(booleanSupplier);

net.minecraft.util.thread.BlockableEventLoop#name()

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:52
  • Modifiers: public
  • Return: String

คืออะไร

ดำเนินการ name ตาม implementation ของ BlockableEventLoop

ทำงานยังไง

คืนค่า: this.name.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

BlockableEventLoop instance = ...;
String result = instance.name();

net.minecraft.util.thread.BlockableEventLoop#pollTask()

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:114
  • Modifiers: public
  • Return: boolean

คืออะไร

ดำเนินการ pollTask ตาม implementation ของ BlockableEventLoop

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. แก้ state: blockingCount. เรียกต่อ: peek(), shouldRun(), doRunTask(), remove(). มีจุด return อย่างน้อย 3 จุด.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

BlockableEventLoop instance = ...;
boolean result = instance.pollTask();

net.minecraft.util.thread.BlockableEventLoop#profiledMetrics()

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:158
  • Modifiers: public
  • Return: List<MetricSampler>

คืออะไร

ดำเนินการ profiledMetrics ตาม implementation ของ BlockableEventLoop

ทำงานยังไง

เรียกต่อ: of(), create(). คืนค่า: ImmutableList.of(MetricSampler.create(this.name + "-pending-tasks", MetricCategory.EVENT_LOOPS, this::getPendingTasksCount)).

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

BlockableEventLoop instance = ...;
List<MetricSampler> result = instance.profiledMetrics();

net.minecraft.util.thread.BlockableEventLoop#runAllTasks()

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:109
  • Modifiers: protected
  • Return: void

คืออะไร

สั่งทำงาน All Tasks

ทำงานยังไง

มีการวนลูป. เรียกต่อ: pollTask().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

@Override
protected void runAllTasks() {
    super.runAllTasks();
}

net.minecraft.util.thread.BlockableEventLoop#schedule(R)

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:86
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ schedule ตาม implementation ของ BlockableEventLoop

ทำงานยังไง

เรียกต่อ: add(), unpark(), getRunningThread().

Parameters

  • R runnable

ตัวอย่างใช้งาน

BlockableEventLoop instance = ...;
R runnable = ...;
instance.schedule(runnable);

net.minecraft.util.thread.BlockableEventLoop#scheduleExecutables()

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:44
  • Modifiers: protected
  • Return: boolean

คืออะไร

ดำเนินการ scheduleExecutables ตาม implementation ของ BlockableEventLoop

ทำงานยังไง

เรียกต่อ: isSameThread(). คืนค่า: !this.isSameThread().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

@Override
protected boolean scheduleExecutables() {
    return super.scheduleExecutables();
}

net.minecraft.util.thread.BlockableEventLoop#shouldRun(R)

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:36
  • Modifiers: protected abstract
  • Return: boolean

คืออะไร

ตรวจสอบว่าควร Run

ทำงานยังไง

ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง

Parameters

  • R runnable

ตัวอย่างใช้งาน

R runnable = ...;
@Override
protected boolean shouldRun(R runnable) {
    return super.shouldRun(runnable);
}

net.minecraft.util.thread.BlockableEventLoop#submit(Runnable)

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:68
  • Modifiers: public
  • Return: CompletableFuture<Void>

คืออะไร

ดำเนินการ submit ตาม implementation ของ BlockableEventLoop

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: scheduleExecutables(), submitAsync(), run(), completedFuture(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • Runnable runnable

ตัวอย่างใช้งาน

BlockableEventLoop instance = ...;
Runnable runnable = ...;
CompletableFuture<Void> result = instance.submit(runnable);

net.minecraft.util.thread.BlockableEventLoop#submit(Supplier<V>)

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:57
  • Modifiers: public
  • Return: CompletableFuture<V>

คืออะไร

ดำเนินการ submit ตาม implementation ของ BlockableEventLoop

ทำงานยังไง

เรียกต่อ: scheduleExecutables(), supplyAsync(), completedFuture(), get(). คืนค่า: this.scheduleExecutables() ? CompletableFuture.supplyAsync(supplier, this) : CompletableFuture.completedFuture(supplier.get()).

Parameters

  • Supplier<V> supplier

ตัวอย่างใช้งาน

BlockableEventLoop instance = ...;
Supplier<V> supplier = ...;
CompletableFuture<V> result = instance.submit(supplier);

net.minecraft.util.thread.BlockableEventLoop#waitForTasks()

  • Origin: common
  • Source: net/minecraft/util/thread/BlockableEventLoop.java:142
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ waitForTasks ตาม implementation ของ BlockableEventLoop

ทำงานยังไง

มีการวนลูป. เรียกต่อ: yield(), parkNanos().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

@Override
protected void waitForTasks() {
    super.waitForTasks();
}

ConsecutiveExecutor

  • Full name: net.minecraft.util.thread.ConsecutiveExecutor
  • Package: net.minecraft.util.thread
  • Source: commonnet/minecraft/util/thread/ConsecutiveExecutor.java
  • Type: class
  • Modifiers: public
  • Extends: AbstractConsecutiveExecutor<Runnable>

net.minecraft.util.thread.ConsecutiveExecutor#ConsecutiveExecutor(Executor,String)

  • Origin: common
  • Source: net/minecraft/util/thread/ConsecutiveExecutor.java:7
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ ConsecutiveExecutor ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

เรียกต่อ: QueueStrictQueue(). สร้างออบเจ็กต์: StrictQueue.QueueStrictQueue, ConcurrentLinkedQueue<>.

Parameters

  • Executor executor
  • String string

ตัวอย่างใช้งาน

Executor executor = ...;
ConsecutiveExecutor instance = new ConsecutiveExecutor(executor, "value");

net.minecraft.util.thread.ConsecutiveExecutor#wrapRunnable(Runnable)

  • Origin: common
  • Source: net/minecraft/util/thread/ConsecutiveExecutor.java:11
  • Modifiers: public
  • Return: Runnable

คืออะไร

ดำเนินการ wrapRunnable ตาม implementation ของ ConsecutiveExecutor

ทำงานยังไง

คืนค่า: runnable.

Parameters

  • Runnable runnable

ตัวอย่างใช้งาน

ConsecutiveExecutor instance = ...;
Runnable runnable = ...;
Runnable result = instance.wrapRunnable(runnable);

NamedThreadFactory

  • Full name: net.minecraft.util.thread.NamedThreadFactory
  • Package: net.minecraft.util.thread
  • Source: commonnet/minecraft/util/thread/NamedThreadFactory.java
  • Type: class
  • Modifiers: public
  • Implements: ThreadFactory

net.minecraft.util.thread.NamedThreadFactory#NamedThreadFactory(String)

  • Origin: common
  • Source: net/minecraft/util/thread/NamedThreadFactory.java:14
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ NamedThreadFactory ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: group, namePrefix. เรียกต่อ: getSecurityManager(), getThreadGroup(), currentThread().

Parameters

  • String string

ตัวอย่างใช้งาน

NamedThreadFactory instance = new NamedThreadFactory("value");

net.minecraft.util.thread.NamedThreadFactory#newThread(Runnable)

  • Origin: common
  • Source: net/minecraft/util/thread/NamedThreadFactory.java:20
  • Modifiers: public
  • Return: Thread

คืออะไร

ดำเนินการ newThread ตาม implementation ของ NamedThreadFactory

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getAndIncrement(), setUncaughtExceptionHandler(), error(), getPriority(), setPriority(). สร้างออบเจ็กต์: Thread. คืนค่า: thread.

Parameters

  • Runnable runnable

ตัวอย่างใช้งาน

NamedThreadFactory instance = ...;
Runnable runnable = ...;
Thread result = instance.newThread(runnable);

PriorityConsecutiveExecutor

  • Full name: net.minecraft.util.thread.PriorityConsecutiveExecutor
  • Package: net.minecraft.util.thread
  • Source: commonnet/minecraft/util/thread/PriorityConsecutiveExecutor.java
  • Type: class
  • Modifiers: public
  • Extends: AbstractConsecutiveExecutor<StrictQueue.RunnableWithPriority>

net.minecraft.util.thread.PriorityConsecutiveExecutor#PriorityConsecutiveExecutor(int,Executor,String)

  • Origin: common
  • Source: net/minecraft/util/thread/PriorityConsecutiveExecutor.java:9
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ PriorityConsecutiveExecutor ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

เรียกต่อ: FixedPriorityQueue(), add(). สร้างออบเจ็กต์: StrictQueue.FixedPriorityQueue.

Parameters

  • int i
  • Executor executor
  • String string

ตัวอย่างใช้งาน

Executor executor = ...;
PriorityConsecutiveExecutor instance = new PriorityConsecutiveExecutor(0, executor, "value");

net.minecraft.util.thread.PriorityConsecutiveExecutor#scheduleWithResult(int,Consumer<CompletableFuture<Source>>)

  • Origin: common
  • Source: net/minecraft/util/thread/PriorityConsecutiveExecutor.java:18
  • Modifiers: public
  • Return: CompletableFuture<Source>

คืออะไร

ดำเนินการ scheduleWithResult ตาม implementation ของ PriorityConsecutiveExecutor

ทำงานยังไง

เรียกต่อ: schedule(), RunnableWithPriority(), accept(). สร้างออบเจ็กต์: CompletableFuture<>, StrictQueue.RunnableWithPriority. คืนค่า: completableFuture.

Parameters

  • int i
  • Consumer<CompletableFuture<Source>> consumer

ตัวอย่างใช้งาน

PriorityConsecutiveExecutor instance = ...;
Consumer<CompletableFuture<Source>> consumer = ...;
CompletableFuture<Source> result = instance.scheduleWithResult(0, consumer);

net.minecraft.util.thread.PriorityConsecutiveExecutor#wrapRunnable(Runnable)

  • Origin: common
  • Source: net/minecraft/util/thread/PriorityConsecutiveExecutor.java:14
  • Modifiers: public
  • Return: StrictQueue.RunnableWithPriority

คืออะไร

ดำเนินการ wrapRunnable ตาม implementation ของ PriorityConsecutiveExecutor

ทำงานยังไง

เรียกต่อ: RunnableWithPriority(). สร้างออบเจ็กต์: StrictQueue.RunnableWithPriority. คืนค่า: new StrictQueue.RunnableWithPriority(0, runnable).

Parameters

  • Runnable runnable

ตัวอย่างใช้งาน

PriorityConsecutiveExecutor instance = ...;
Runnable runnable = ...;
StrictQueue.RunnableWithPriority result = instance.wrapRunnable(runnable);

ReentrantBlockableEventLoop

  • Full name: net.minecraft.util.thread.ReentrantBlockableEventLoop
  • Package: net.minecraft.util.thread
  • Source: commonnet/minecraft/util/thread/ReentrantBlockableEventLoop.java
  • Type: class
  • Modifiers: public abstract
  • Extends: BlockableEventLoop<R>

net.minecraft.util.thread.ReentrantBlockableEventLoop#doRunTask(R)

  • Origin: common
  • Source: net/minecraft/util/thread/ReentrantBlockableEventLoop.java:19
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ doRunTask ตาม implementation ของ ReentrantBlockableEventLoop

ทำงานยังไง

มีการจัดการ exception. แก้ state: reentrantCount.

Parameters

  • R runnable

ตัวอย่างใช้งาน

ReentrantBlockableEventLoop instance = ...;
R runnable = ...;
instance.doRunTask(runnable);

net.minecraft.util.thread.ReentrantBlockableEventLoop#ReentrantBlockableEventLoop(String)

  • Origin: common
  • Source: net/minecraft/util/thread/ReentrantBlockableEventLoop.java:6
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ ReentrantBlockableEventLoop ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

ทำงานตาม body โดยตรง (ประมาณ 1 statement).

Parameters

  • String string

ตัวอย่างใช้งาน

ReentrantBlockableEventLoop instance = new ReentrantBlockableEventLoop("value");

net.minecraft.util.thread.ReentrantBlockableEventLoop#runningTask()

  • Origin: common
  • Source: net/minecraft/util/thread/ReentrantBlockableEventLoop.java:15
  • Modifiers: protected
  • Return: boolean

คืออะไร

ดำเนินการ runningTask ตาม implementation ของ ReentrantBlockableEventLoop

ทำงานยังไง

คืนค่า: this.reentrantCount != 0.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

@Override
protected boolean runningTask() {
    return super.runningTask();
}

net.minecraft.util.thread.ReentrantBlockableEventLoop#scheduleExecutables()

  • Origin: common
  • Source: net/minecraft/util/thread/ReentrantBlockableEventLoop.java:10
  • Modifiers: public
  • Return: boolean

คืออะไร

ดำเนินการ scheduleExecutables ตาม implementation ของ ReentrantBlockableEventLoop

ทำงานยังไง

เรียกต่อ: runningTask(). คืนค่า: this.runningTask() || super.scheduleExecutables().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

ReentrantBlockableEventLoop instance = ...;
boolean result = instance.scheduleExecutables();

StrictQueue

  • Full name: net.minecraft.util.thread.StrictQueue
  • Package: net.minecraft.util.thread
  • Source: commonnet/minecraft/util/thread/StrictQueue.java
  • Type: interface
  • Modifiers: public

net.minecraft.util.thread.StrictQueue#isEmpty()

  • Origin: common
  • Source: net/minecraft/util/thread/StrictQueue.java:15
  • Modifiers: ``
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Empty

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

StrictQueue instance = ...;
boolean result = instance.isEmpty();

net.minecraft.util.thread.StrictQueue#pop()

  • Origin: common
  • Source: net/minecraft/util/thread/StrictQueue.java:10
  • Modifiers: ``
  • Return: Runnable

คืออะไร

ดำเนินการ pop ตาม implementation ของ StrictQueue

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

StrictQueue instance = ...;
Runnable result = instance.pop();

net.minecraft.util.thread.StrictQueue#push(T)

  • Origin: common
  • Source: net/minecraft/util/thread/StrictQueue.java:13
  • Modifiers: ``
  • Return: boolean

คืออะไร

ดำเนินการ push ตาม implementation ของ StrictQueue

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • T runnable

ตัวอย่างใช้งาน

StrictQueue instance = ...;
T runnable = ...;
boolean result = instance.push(runnable);

net.minecraft.util.thread.StrictQueue#size()

  • Origin: common
  • Source: net/minecraft/util/thread/StrictQueue.java:17
  • Modifiers: ``
  • Return: int

คืออะไร

ดำเนินการ size ตาม implementation ของ StrictQueue

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

StrictQueue instance = ...;
int result = instance.size();

TaskScheduler

  • Full name: net.minecraft.util.thread.TaskScheduler
  • Package: net.minecraft.util.thread
  • Source: commonnet/minecraft/util/thread/TaskScheduler.java
  • Type: interface
  • Modifiers: public
  • Implements: AutoCloseable

net.minecraft.util.thread.TaskScheduler#close()

  • Origin: common
  • Source: net/minecraft/util/thread/TaskScheduler.java:12
  • Modifiers: default
  • Return: void

คืออะไร

ปิด close

ทำงานยังไง

ทำงานตาม body โดยตรง (ประมาณ 1 statement).

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

TaskScheduler instance = ...;
instance.close();

net.minecraft.util.thread.TaskScheduler#name()

  • Origin: common
  • Source: net/minecraft/util/thread/TaskScheduler.java:8
  • Modifiers: ``
  • Return: String

คืออะไร

ดำเนินการ name ตาม implementation ของ TaskScheduler

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

TaskScheduler instance = ...;
String result = instance.name();

net.minecraft.util.thread.TaskScheduler#schedule(R)

  • Origin: common
  • Source: net/minecraft/util/thread/TaskScheduler.java:10
  • Modifiers: ``
  • Return: void

คืออะไร

ดำเนินการ schedule ตาม implementation ของ TaskScheduler

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • R runnable

ตัวอย่างใช้งาน

TaskScheduler instance = ...;
R runnable = ...;
instance.schedule(runnable);

net.minecraft.util.thread.TaskScheduler#scheduleWithResult(Consumer<CompletableFuture<Source>>)

  • Origin: common
  • Source: net/minecraft/util/thread/TaskScheduler.java:18
  • Modifiers: default
  • Return: CompletableFuture<Source>

คืออะไร

ดำเนินการ scheduleWithResult ตาม implementation ของ TaskScheduler

ทำงานยังไง

เรียกต่อ: schedule(), wrapRunnable(), accept(). สร้างออบเจ็กต์: CompletableFuture<>. คืนค่า: completableFuture.

Parameters

  • Consumer<CompletableFuture<Source>> consumer

ตัวอย่างใช้งาน

TaskScheduler instance = ...;
Consumer<CompletableFuture<Source>> consumer = ...;
CompletableFuture<Source> result = instance.scheduleWithResult(consumer);

net.minecraft.util.thread.TaskScheduler#wrapExecutor(String,Executor)

  • Origin: common
  • Source: net/minecraft/util/thread/TaskScheduler.java:24
  • Modifiers: static
  • Return: TaskScheduler<Runnable>

คืออะไร

ดำเนินการ wrapExecutor ตาม implementation ของ TaskScheduler

ทำงานยังไง

เรียกต่อ: name(), schedule(), execute(), wrapRunnable(), toString(). สร้างออบเจ็กต์: TaskScheduler<Runnable>. มีจุด return อย่างน้อย 3 จุด.

Parameters

  • String string
  • Executor executor

ตัวอย่างใช้งาน

Executor executor = ...;
TaskScheduler<Runnable> result = TaskScheduler.wrapExecutor("value", executor);

net.minecraft.util.thread.TaskScheduler#wrapRunnable(Runnable)

  • Origin: common
  • Source: net/minecraft/util/thread/TaskScheduler.java:16
  • Modifiers: ``
  • Return: R

คืออะไร

ดำเนินการ wrapRunnable ตาม implementation ของ TaskScheduler

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • Runnable runnable

ตัวอย่างใช้งาน

TaskScheduler instance = ...;
Runnable runnable = ...;
R result = instance.wrapRunnable(runnable);