进阶day06-线程池:处理runnable任务

This commit is contained in:
2026-03-10 10:23:03 +08:00
parent a996cfdb1a
commit 7bdd904e54
2 changed files with 76 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
package com.inmind.thread_pool10;
public class MyRunnable implements Runnable{
@Override
public void run() {
System.out.println(Thread.currentThread().getName()+"执行了任务");
try {
Thread.sleep(100000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}