This commit is contained in:
Eric Buxkemper 2015-11-13 10:06:46 -06:00
parent b9476e9db1
commit 1e1a03c104
2 changed files with 4 additions and 24 deletions

View file

@ -13,20 +13,6 @@ void BoundedBuffer::push(string item){
}
string BoundedBuffer::pop(){
<<<<<<< HEAD
if(data.size() > 0){
full->P();
mutex->P();
string item = data.back();
data.pop_back();
mutex->V();
empty->V();
return item;
}else{
return "quit";
}
=======
full->P();
mutex->P();
string item = data.back();
@ -34,6 +20,5 @@ string BoundedBuffer::pop(){
mutex->V();
empty->V();
return item;
>>>>>>> 05aaecdb17812b161db2168b80a19fc2c783800b
}

View file

@ -25,10 +25,6 @@ public:
BoundedBuffer(int b){
empty = new Semaphore(b);
}
<<<<<<< HEAD
void set_empty(int e){empty = new Semaphore(e);}
=======
void set_empty(int e){
delete empty;
empty = new Semaphore(e);
@ -37,7 +33,6 @@ public:
bool is_empty() {
return (data.size() == 0);
}
>>>>>>> 05aaecdb17812b161db2168b80a19fc2c783800b
void push(string item);