diff --git a/src/base/signal.h b/src/base/signal.h index 5eb078fa..09704957 100644 --- a/src/base/signal.h +++ b/src/base/signal.h @@ -38,12 +38,12 @@ class ISignalThreadHelper { // Get implementation-specific context object for the current thread virtual std::any getCurrentThreadContext() = 0; - // Executes function 'fn' in target thread referred by 'context' + // Posts the function 'fn' to target thread referred by 'context' // If current thread is different from target thread then implementation has to ensure 'fn' is - // executed in target thread(eg by enqueuing 'fn' in some event loop) + // executed on target thread(eg by enqueuing 'fn' in some event loop) // 'context' is the implementation-specific thread context object identified in a previous call // to getCurrentThreadContext() - virtual void execInThread(const std::any& context, const std::function& fn) = 0; + virtual void runOnThread(const std::any& context, const std::function& fn) = 0; }; // Getter/setter functions of the global ISignalThreadHelper object used by Signal::connectSlot() @@ -89,7 +89,7 @@ class Signal : public KDBindings::Signal { if (emitThreadId == connectThreadId) fnSlot(args...); else - getGlobalSignalThreadHelper()->execInThread(threadContext, [=]{ fnSlot(args...); }); + getGlobalSignalThreadHelper()->runOnThread(threadContext, [=]{ fnSlot(args...); }); }; return this->connect(fnWrap); } diff --git a/src/qtbackend/qt_signal_thread_helper.cpp b/src/qtbackend/qt_signal_thread_helper.cpp index 06cf28ec..7bbcd95c 100644 --- a/src/qtbackend/qt_signal_thread_helper.cpp +++ b/src/qtbackend/qt_signal_thread_helper.cpp @@ -18,7 +18,7 @@ std::any QtSignalThreadHelper::getCurrentThreadContext() return &obj; } -void QtSignalThreadHelper::execInThread(const std::any& context, const std::function& fn) +void QtSignalThreadHelper::runOnThread(const std::any& context, const std::function& fn) { QTimer::singleShot(0, std::any_cast(context), fn); } diff --git a/src/qtbackend/qt_signal_thread_helper.h b/src/qtbackend/qt_signal_thread_helper.h index dadbbe95..199487de 100644 --- a/src/qtbackend/qt_signal_thread_helper.h +++ b/src/qtbackend/qt_signal_thread_helper.h @@ -15,7 +15,7 @@ namespace Mayo { class QtSignalThreadHelper : public ISignalThreadHelper { public: std::any getCurrentThreadContext() override; - void execInThread(const std::any& context, const std::function& fn) override; + void runOnThread(const std::any& context, const std::function& fn) override; }; } // namespace Mayo