summaryrefslogtreecommitdiff
path: root/src/mongo/util/queue.h
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2015-11-04 18:45:16 -0500
committerMathias Stearn <mathias@10gen.com>2015-11-04 18:45:16 -0500
commitd70512ab5f655868b409bcbf92d1e68af80e68d8 (patch)
tree8a0463264acf349dbbd8eb3e5ca1246a8b50378a /src/mongo/util/queue.h
parented6c7908a51b92311efad30df78a390fa96e990f (diff)
downloadmongo-d70512ab5f655868b409bcbf92d1e68af80e68d8.tar.gz
Revert "SERVER-21154 Batch and parse oplog entries in parallel with applying them"
This reverts commit 2f70889bbfd4dea77cd26cec2dde28193b06905d.
Diffstat (limited to 'src/mongo/util/queue.h')
-rw-r--r--src/mongo/util/queue.h20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/mongo/util/queue.h b/src/mongo/util/queue.h
index 6cdb62538ef..a1b8caac1a0 100644
--- a/src/mongo/util/queue.h
+++ b/src/mongo/util/queue.h
@@ -32,10 +32,9 @@
#include <limits>
#include <queue>
-#include "mongo/base/disallow_copying.h"
#include "mongo/stdx/chrono.h"
#include "mongo/stdx/condition_variable.h"
-#include "mongo/stdx/mutex.h"
+#include "mongo/base/disallow_copying.h"
namespace mongo {
@@ -63,11 +62,6 @@ public:
BlockingQueue(size_t size) : _maxSize(size), _getSize(&_getSizeDefault) {}
BlockingQueue(size_t size, getSizeFunc f) : _maxSize(size), _getSize(f) {}
- void pushEvenIfFull(T const& t) {
- stdx::unique_lock<stdx::mutex> l(_lock);
- pushImpl_inlock(t, _getSize(t));
- }
-
void push(T const& t) {
stdx::unique_lock<stdx::mutex> l(_lock);
_clearing = false;
@@ -75,7 +69,9 @@ public:
while (_currentSize + tSize > _maxSize) {
_cvNoLongerFull.wait(l);
}
- pushImpl_inlock(t, tSize);
+ _queue.push(t);
+ _currentSize += tSize;
+ _cvNoLongerEmpty.notify_one();
}
bool empty() const {
@@ -202,14 +198,6 @@ public:
}
private:
- void pushImpl_inlock(const T& obj, size_t objSize) {
- _clearing = false;
- _queue.push(obj);
- _currentSize += objSize;
- if (_queue.size() == 1) // We were empty.
- _cvNoLongerEmpty.notify_one();
- }
-
mutable stdx::mutex _lock;
std::queue<T> _queue;
const size_t _maxSize;