common/thread: Make Barrier's 'count' member non-const

While admirable as a means to ensure immutability, this has the
unfortunate downside of making the class non-movable. std::move cannot
actually perform a move operation if the provided operand has const data
members (std::move acts as an operation to "slide" resources out of an
object instance). Given Barrier contains move-only types such as
std::mutex, this can lead to confusing error messages if an object ever
contained a Barrier instance and said object was attempted to be moved.
This commit is contained in:
Lioncash 2018-11-21 21:47:06 -05:00 committed by fearlessTobi
parent 4f0ec03c97
commit 255d46e6ee

View File

@ -82,7 +82,7 @@ public:
private:
std::condition_variable condvar;
std::mutex mutex;
const std::size_t count;
std::size_t count;
std::size_t waiting = 0;
std::size_t generation = 0; // Incremented once each time the barrier is used
};