We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2fbd089 commit 7c56765Copy full SHA for 7c56765
docs/java/multi-thread/java线程池学习总结.md
@@ -545,7 +545,7 @@ public interface Callable<V> {
545
1. **`execute()`方法用于提交不需要返回值的任务,所以无法判断任务是否被线程池执行成功与否;**
546
2. **`submit()`方法用于提交需要返回值的任务。线程池会返回一个 `Future` 类型的对象,通过这个 `Future` 对象可以判断任务是否执行成功** ,并且可以通过 `Future` 的 `get()`方法来获取返回值,`get()`方法会阻塞当前线程直到任务完成,而使用 `get(long timeout,TimeUnit unit)`方法则会阻塞当前线程一段时间后立即返回,这时候有可能任务没有执行完。
547
548
-我们以**`AbstractExecutorService`**接口中的一个 `submit` 方法为例子来看看源代码:
+我们以 **`AbstractExecutorService`** 接口中的一个 `submit()` 方法为例子来看看源代码:
549
550
```java
551
public Future<?> submit(Runnable task) {
0 commit comments