Skip to content

Commit

Permalink
Modify
Browse files Browse the repository at this point in the history
  • Loading branch information
CharonChui committed Feb 11, 2014
1 parent cc746ca commit eee5d06
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions 生产者消费者.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ JDK1.5 中提供了多线程升级解决方案。 将同步Synchronized替换成
将Object中的wait,notify notifyAll,替换了Condition对象。 该对象可以Lock锁 进行获取。 该示例中,实现了本方只唤醒对方操作。
Lock:替代了Synchronized lock unlock newCondition()
Condition:替代了Object wait notify notifyAll await(); signal(); signalAll();
```java
import java.util.concurrent.locks.*;

```java
import java.util.concurrent.locks.*;

public class ProducerConsumerDemo2 {
public static void main(String[] args) {
Expand Down Expand Up @@ -195,8 +196,8 @@ class Consumer implements Runnable {
}
}
}
```

```
---

- 邮箱 :[email protected]
Expand Down

0 comments on commit eee5d06

Please sign in to comment.