MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / setThreadPriority

Method setThreadPriority

src/main/java/net/minecraft/src/Config.java:374–396  ·  view source on GitHub ↗
(String p_setThreadPriority_0_, int p_setThreadPriority_1_)

Source from the content-addressed store, hash-verified

372 }
373
374 private static void setThreadPriority(String p_setThreadPriority_0_, int p_setThreadPriority_1_) {
375 try {
376 ThreadGroup threadgroup = Thread.currentThread().getThreadGroup();
377
378 if (threadgroup == null) {
379 return;
380 }
381
382 int i = (threadgroup.activeCount() + 10) * 2;
383 Thread[] athread = new Thread[i];
384 threadgroup.enumerate(athread, false);
385
386 for (int j = 0; j < athread.length; ++j) {
387 Thread thread = athread[j];
388
389 if (thread != null && thread.getName().startsWith(p_setThreadPriority_0_)) {
390 thread.setPriority(p_setThreadPriority_1_);
391 }
392 }
393 } catch (Throwable throwable) {
394 warn(throwable.getClass().getName() + ": " + throwable.getMessage());
395 }
396 }
397
398 public static boolean isMinecraftThread() {
399 return Thread.currentThread() == minecraftThread;

Callers 1

Calls 5

warnMethod · 0.95
startsWithMethod · 0.80
setPriorityMethod · 0.80
getNameMethod · 0.65
getMessageMethod · 0.45

Tested by

no test coverage detected