From 1e1a03c104159a8b30db32e07de1096827640ea0 Mon Sep 17 00:00:00 2001 From: Eric Buxkemper Date: Fri, 13 Nov 2015 10:06:46 -0600 Subject: [PATCH] fix --- BoundedBuffer.cpp | 19 ++----------------- BoundedBuffer.h | 9 ++------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/BoundedBuffer.cpp b/BoundedBuffer.cpp index 1d52b88..99a3597 100644 --- a/BoundedBuffer.cpp +++ b/BoundedBuffer.cpp @@ -12,28 +12,13 @@ void BoundedBuffer::push(string item){ full->V();//increment the number of full slots now. } -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"; - } - -======= +string BoundedBuffer::pop(){ full->P(); mutex->P(); string item = data.back(); data.pop_back(); mutex->V(); empty->V(); - return item; ->>>>>>> 05aaecdb17812b161db2168b80a19fc2c783800b + return item; } \ No newline at end of file diff --git a/BoundedBuffer.h b/BoundedBuffer.h index cf70b37..c20a4bb 100644 --- a/BoundedBuffer.h +++ b/BoundedBuffer.h @@ -24,11 +24,7 @@ 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); @@ -36,8 +32,7 @@ public: bool is_empty() { return (data.size() == 0); - } ->>>>>>> 05aaecdb17812b161db2168b80a19fc2c783800b + } void push(string item);