Skip to content

Commit a392fbd

Browse files
committed
Base: rename ISignalThreadHelper::execInThread() to runOnThread()
1 parent 2724762 commit a392fbd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/base/signal.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ class ISignalThreadHelper {
3838
// Get implementation-specific context object for the current thread
3939
virtual std::any getCurrentThreadContext() = 0;
4040

41-
// Executes function 'fn' in target thread referred by 'context'
41+
// Posts the function 'fn' to target thread referred by 'context'
4242
// If current thread is different from target thread then implementation has to ensure 'fn' is
43-
// executed in target thread(eg by enqueuing 'fn' in some event loop)
43+
// executed on target thread(eg by enqueuing 'fn' in some event loop)
4444
// 'context' is the implementation-specific thread context object identified in a previous call
4545
// to getCurrentThreadContext()
46-
virtual void execInThread(const std::any& context, const std::function<void()>& fn) = 0;
46+
virtual void runOnThread(const std::any& context, const std::function<void()>& fn) = 0;
4747
};
4848

4949
// Getter/setter functions of the global ISignalThreadHelper object used by Signal::connectSlot()
@@ -89,7 +89,7 @@ class Signal : public KDBindings::Signal<Args...> {
8989
if (emitThreadId == connectThreadId)
9090
fnSlot(args...);
9191
else
92-
getGlobalSignalThreadHelper()->execInThread(threadContext, [=]{ fnSlot(args...); });
92+
getGlobalSignalThreadHelper()->runOnThread(threadContext, [=]{ fnSlot(args...); });
9393
};
9494
return this->connect(fnWrap);
9595
}

src/qtbackend/qt_signal_thread_helper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ std::any QtSignalThreadHelper::getCurrentThreadContext()
1818
return &obj;
1919
}
2020

21-
void QtSignalThreadHelper::execInThread(const std::any& context, const std::function<void()>& fn)
21+
void QtSignalThreadHelper::runOnThread(const std::any& context, const std::function<void()>& fn)
2222
{
2323
QTimer::singleShot(0, std::any_cast<QObject*>(context), fn);
2424
}

src/qtbackend/qt_signal_thread_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Mayo {
1515
class QtSignalThreadHelper : public ISignalThreadHelper {
1616
public:
1717
std::any getCurrentThreadContext() override;
18-
void execInThread(const std::any& context, const std::function<void()>& fn) override;
18+
void runOnThread(const std::any& context, const std::function<void()>& fn) override;
1919
};
2020

2121
} // namespace Mayo

0 commit comments

Comments
 (0)