#include "semaphore.h"
#include "BoundedBuffer.h"
#include <string>
#include <vector>
void BoundedBuffer::push(string item){
empty->P();
mutex->P();
data.push_back(item);
mutex->V();
full->V();//increment the number of full slots now.
}
string BoundedBuffer::pop(){
full->P();
string item = data.back();
data.pop_back();
empty->V();
return item;