(String p_setThreadPriority_0_, int p_setThreadPriority_1_)
| 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; |
no test coverage detected