auto commit

This commit is contained in:
CyC2018 2018-03-03 16:43:09 +08:00
parent a74e6762e2
commit b64ecc6dbe

View File

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