Added a Flush method to the RunQueue

This commit is contained in:
Benoit Steiner 2016-12-08 14:07:56 -08:00
parent 69ef267a77
commit 28ee8f42b2

View File

@ -177,6 +177,13 @@ class RunQueue {
// Can be called by any thread at any time.
bool Empty() const { return Size() == 0; }
// Delete all the elements from the queue.
void Flush() {
while (!Empty()) {
PopFront();
}
}
private:
static const unsigned kMask = kSize - 1;
static const unsigned kMask2 = (kSize << 1) - 1;