From a4b3ee3f71b95590ed14805742ba91dcc71bfa71 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 2 Dec 2021 15:16:05 -0700 Subject: [PATCH] Explicitly disallow copying or moving TaskData objects. --- include/deal.II/base/thread_management.h | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/include/deal.II/base/thread_management.h b/include/deal.II/base/thread_management.h index e5bcc12e0a..265768f35d 100644 --- a/include/deal.II/base/thread_management.h +++ b/include/deal.II/base/thread_management.h @@ -1296,6 +1296,31 @@ namespace Threads , task_has_finished(false) {} + /** + * There can only be one TaskData object referencing + * a task. Make sure that these objects are not copied. + */ + TaskData(const TaskData &) = delete; + + /** + * There can only be one TaskData object referencing + * a task. Make sure that these objects are not moved. + */ + TaskData(TaskData &&) = delete; + + /** + * There can only be one TaskData object referencing + * a task. Make sure that these objects are not copied. + */ + TaskData & + operator=(const TaskData &) = delete; + + /** + * There can only be one TaskData object referencing + * a task. Make sure that these objects are not moved. + */ + TaskData & + operator=(TaskData &&) = delete; /** * Destructor. Wait for the results to be ready. This ensures that the -- 2.39.5