| 40 | } |
| 41 | |
| 42 | bool Push(Element const& element) |
| 43 | { |
| 44 | bool pushed; |
| 45 | std::lock_guard<std::mutex> lock(mMutex); |
| 46 | if (mQueue.size() < mMaxNumElements) |
| 47 | { |
| 48 | mQueue.push(element); |
| 49 | pushed = true; |
| 50 | } |
| 51 | else |
| 52 | { |
| 53 | pushed = false; |
| 54 | } |
| 55 | return pushed; |
| 56 | } |
| 57 | |
| 58 | bool Pop(Element& element) |
| 59 | { |