diff options
Diffstat (limited to 'unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h')
-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; |