auto commit

This commit is contained in:
CyC2018 2018-03-13 11:11:28 +08:00
parent df928c793d
commit 2ee324eec1

View File

@ -310,7 +310,7 @@ semaphore full = 0;
void producer() { void producer() {
while(TRUE){ while(TRUE){
int item = produce_item; int item = produce_item();
down(empty); down(empty);
down(mutex); down(mutex);
insert_item(item); insert_item(item);
@ -323,7 +323,7 @@ void consumer() {
while(TRUE){ while(TRUE){
down(full); down(full);
down(mutex); down(mutex);
int item = remove_item(item); int item = remove_item();
up(mutex); up(mutex);
up(empty); up(empty);
consume_item(item); consume_item(item);