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