Skip to content

Commit

Permalink
delete copy/move ctor of MPMCQueue explicitly (#5328)
Browse files Browse the repository at this point in the history
close #5329
  • Loading branch information
guo-shaoge authored Jul 11, 2022
1 parent 1388c11 commit 34d7570
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dbms/src/Common/MPMCQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#pragma once

#include <Common/SimpleIntrusiveNode.h>
#include <Common/nocopyable.h>
#include <common/defines.h>
#include <common/types.h>

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 34d7570

Please sign in to comment.