diff --git a/dbms/src/Common/MPMCQueue.h b/dbms/src/Common/MPMCQueue.h index 31dfc65a174..e005c363eae 100644 --- a/dbms/src/Common/MPMCQueue.h +++ b/dbms/src/Common/MPMCQueue.h @@ -15,6 +15,7 @@ #pragma once #include +#include #include #include @@ -74,6 +75,11 @@ class MPMCQueue destruct(getObj(read_pos)); } + // Cannot to use copy/move constructor, + // because MPMCQueue maybe used by different threads. + // Copy and move it is dangerous. + DISALLOW_COPY_AND_MOVE(MPMCQueue); + /// Block until: /// 1. Pop succeeds with a valid T: return true. /// 2. The queue is cancelled or finished: return false.