auto commit

This commit is contained in:
CyC2018 2018-03-03 16:02:18 +08:00
commit 2900f7a8c8

View File

@ -269,7 +269,11 @@ down 和 up 操作需要被设计成原语,不可分割,通常的做法是
如果信号量的取值只能为 0 或者 1那么就成为了**互斥量Mutex**0 表示临界区已经加锁1 表示临界区解锁。
```c
<<<<<<< HEAD
typedef int semaphore ;
=======
typedef int semaphore;
>>>>>>> bedf25d3f0312d8e38953d742d42dbf87585980e
semaphore mutex = 1;
void P1() {
down(mutex);
@ -292,7 +296,11 @@ void P2() {
```c
#define N 100
<<<<<<< HEAD
typedef int semaphore ;
=======
typedef int semaphore;
>>>>>>> bedf25d3f0312d8e38953d742d42dbf87585980e
semaphore mutex = 1;
semaphore empty = N;
semaphore full = 0;