From 56c6373f82d4cf42a489951fb08566d3e5b612ef Mon Sep 17 00:00:00 2001 From: Eugene Zhulenev Date: Tue, 5 Mar 2019 11:51:26 -0800 Subject: Add an extra check for the RunQueue size estimate --- unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'unsupported/Eigen/CXX11/src/ThreadPool') diff --git a/unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h b/unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h index ecdc35f81..a9ae05fc6 100644 --- a/unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h +++ b/unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h @@ -209,7 +209,9 @@ class RunQueue { } else { // This value will be 0 if the queue is empty, and undefined otherwise. unsigned maybe_zero = ((front ^ back) & kMask2); - eigen_assert(maybe_zero == 0 ? CalculateSize(front, back) == 0 : true); + // Queue size estimate must agree with maybe zero check on the queue + // empty/non-empty state. + eigen_assert((CalculateSize(front, back) == 0) == (maybe_zero == 0)); return maybe_zero; } } -- cgit v1.2.3