auto commit
This commit is contained in:
parent
df928c793d
commit
2ee324eec1
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user