diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-12-08 14:07:56 -0800 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-12-08 14:07:56 -0800 |
commit | 28ee8f42b269c5da474c550dc8d35fe41c085429 (patch) | |
tree | d8396b1eb4b4f069047807dd0457b8cc95d49798 /unsupported/Eigen/CXX11/src/ThreadPool | |
parent | 69ef267a77c1259133793c017c2f95f5378d11be (diff) |
Added a Flush method to the RunQueue
Diffstat (limited to 'unsupported/Eigen/CXX11/src/ThreadPool')
-rw-r--r-- | unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h b/unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h index 05ed76cbe..49d0cdc36 100644 --- a/unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h +++ b/unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h @@ -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; |