修改了部分笔误

This commit is contained in:
xiangflight 2018-07-23 20:24:46 +08:00
parent 6d0d5cb163
commit 8240e3040e
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -352,7 +352,7 @@ end monitor;
管程引入了 **条件变量** 以及相关的操作:**wait()** 和 **signal()** 来实现同步操作。对条件变量执行 wait() 操作会导致调用进程阻塞把管程让出来给另一个进程持有。signal() 操作用于唤醒被阻塞的进程。
<font size=3> **使用管程实现生者-消费者问题** </font><br>
<font size=3> **使用管程实现生者-消费者问题** </font><br>
```pascal
// 管程