Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete copy/move ctor of MPMCQueue explicitly #5328

Merged
merged 4 commits into from
Jul 11, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions dbms/src/Common/MPMCQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ 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.
MPMCQueue(const MPMCQueue<T> &) = delete;
guo-shaoge marked this conversation as resolved.
Show resolved Hide resolved
MPMCQueue(MPMCQueue<T> &&) = delete;
MPMCQueue<T> & operator=(const MPMCQueue<T> &) = delete;

/// Block until:
/// 1. Pop succeeds with a valid T: return true.
/// 2. The queue is cancelled or finished: return false.
Expand Down