15 lines
No EOL
232 B
C++
Executable file
15 lines
No EOL
232 B
C++
Executable file
|
|
void BoundedBuffer::push(string item){
|
|
|
|
empty.P();
|
|
data.push_back(item);
|
|
|
|
full.V();//increment the number of full slots now.
|
|
}
|
|
|
|
void BoundedBuffer::pop(){
|
|
full.P();
|
|
data.pop(item);
|
|
empty.V();
|
|
}
|
|
|