aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/ThreadPool
diff options
context:
space:
mode:
authorGravatar Eugene Zhulenev <ezhulenev@google.com>2019-03-05 11:51:26 -0800
committerGravatar Eugene Zhulenev <ezhulenev@google.com>2019-03-05 11:51:26 -0800
commit56c6373f82d4cf42a489951fb08566d3e5b612ef (patch)
treeb44cca326f5cf4d9e095e7d43c814b7229205f1b /unsupported/Eigen/CXX11/src/ThreadPool
parentb1a862749362572a0c1075e2381e6dd58a71c3fb (diff)
Add an extra check for the RunQueue size estimate
Diffstat (limited to 'unsupported/Eigen/CXX11/src/ThreadPool')
-rw-r--r--unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h4
1 files changed, 3 insertions, 1 deletions
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;
}
}