测试线程池
parent
71f4a1d695
commit
ef9f2e4b6a
|
@ -293,11 +293,14 @@ public class PriorityThreadPool {
|
||||||
public static void executeLow(Runnable task) {
|
public static void executeLow(Runnable task) {
|
||||||
try {
|
try {
|
||||||
lowPrioritySemaphore.acquire();
|
lowPrioritySemaphore.acquire();
|
||||||
|
log.info("获取许可");
|
||||||
executor.submit(() -> {
|
executor.submit(() -> {
|
||||||
try {
|
try {
|
||||||
|
log.info("开始执行任务");
|
||||||
task.run();
|
task.run();
|
||||||
|
log.info("执行任务完毕??");
|
||||||
} finally {
|
} finally {
|
||||||
lowPrioritySemaphore.release();
|
// lowPrioritySemaphore.release();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
|
Loading…
Reference in New Issue