mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Call IProcessor::onCancel() once
This commit is contained in:
parent
438cd4af09
commit
943f9f541b
@ -237,11 +237,12 @@ public:
|
||||
|
||||
/// In case if query was cancelled executor will wait till all processors finish their jobs.
|
||||
/// Generally, there is no reason to check this flag. However, it may be reasonable for long operations (e.g. i/o).
|
||||
bool isCancelled() const { return is_cancelled; }
|
||||
bool isCancelled() const { return is_cancelled.load(std::memory_order_acquire); }
|
||||
void cancel()
|
||||
{
|
||||
is_cancelled = true;
|
||||
onCancel();
|
||||
bool already_cancelled = is_cancelled.exchange(true, std::memory_order_acq_rel);
|
||||
if (!already_cancelled)
|
||||
onCancel();
|
||||
}
|
||||
|
||||
/// Additional method which is called in case if ports were updated while work() method.
|
||||
|
Loading…
Reference in New Issue
Block a user