From 6a6428e131ff852c96fe69bc4c8c13f3040a131f Mon Sep 17 00:00:00 2001 From: xiehan <52160700+Barenboim@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:14:10 +0800 Subject: [PATCH] Fix function overload resolution. (#1667) --- src/client/WFKafkaClient.cc | 2 +- src/factory/WFTaskFactory.h | 29 +++++++++++++++++++++++++++++ src/factory/WFTaskFactory.inl | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/client/WFKafkaClient.cc b/src/client/WFKafkaClient.cc index 8339aed961..6bf5aff2fd 100644 --- a/src/client/WFKafkaClient.cc +++ b/src/client/WFKafkaClient.cc @@ -312,7 +312,7 @@ void KafkaClientTask::kafka_rebalance_callback(__WFKafkaTask *task) snprintf(name, 64, "%p.cgroup", member); member->mutex.unlock(); - WFTaskFactory::signal_by_name(name, NULL, max); + WFTaskFactory::signal_by_name(name, (void *)NULL, max); } else { diff --git a/src/factory/WFTaskFactory.h b/src/factory/WFTaskFactory.h index 383456723f..ad5b9b0f65 100644 --- a/src/factory/WFTaskFactory.h +++ b/src/factory/WFTaskFactory.h @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include #include @@ -421,6 +423,33 @@ class WFTaskFactory task->sub_series()->set_last_task(last); return task; } + +public: + /* The following functions are for overload resolution only. */ + + static int send_by_name(const std::string& mailbox_name, intptr_t msg, + size_t max) + { + return WFTaskFactory::send_by_name(mailbox_name, (void *)msg, max); + } + + static int send_by_name(const std::string& mailbox_name, std::nullptr_t msg, + size_t max) + { + return WFTaskFactory::send_by_name(mailbox_name, (void *)0, max); + } + + static int signal_by_name(const std::string& cond_name, intptr_t msg, + size_t max) + { + return WFTaskFactory::signal_by_name(cond_name, (void *)msg, max); + } + + static int signal_by_name(const std::string& cond_name, std::nullptr_t msg, + size_t max) + { + return WFTaskFactory::signal_by_name(cond_name, (void *)0, max); + } }; template diff --git a/src/factory/WFTaskFactory.inl b/src/factory/WFTaskFactory.inl index 07bd44397f..8da3a6867e 100644 --- a/src/factory/WFTaskFactory.inl +++ b/src/factory/WFTaskFactory.inl @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include