提交 8240e304 编写于 作者: X xiangflight

修改了部分笔误

上级 6d0d5cb1
......@@ -952,7 +952,7 @@ produce..produce..consume..consume..produce..consume..produce..consume..produce.
```java
public class ForkJoinExample extends RecursiveTask<Integer> {
private final int threhold = 5;
private final int threshold = 5;
private int first;
private int last;
......@@ -964,7 +964,7 @@ public class ForkJoinExample extends RecursiveTask<Integer> {
@Override
protected Integer compute() {
int result = 0;
if (last - first <= threhold) {
if (last - first <= threshold) {
// 任务足够小则直接计算
for (int i = first; i <= last; i++) {
result += i;
......
......@@ -352,7 +352,7 @@ end monitor;
管程引入了 **条件变量** 以及相关的操作:**wait()****signal()** 来实现同步操作。对条件变量执行 wait() 操作会导致调用进程阻塞,把管程让出来给另一个进程持有。signal() 操作用于唤醒被阻塞的进程。
<font size=3> **使用管程实现生者-消费者问题** </font><br>
<font size=3> **使用管程实现生者-消费者问题** </font><br>
```pascal
// 管程
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册