File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -38,12 +38,12 @@ class ISignalThreadHelper {
38
38
// Get implementation-specific context object for the current thread
39
39
virtual std::any getCurrentThreadContext () = 0;
40
40
41
- // Executes function 'fn' in target thread referred by 'context'
41
+ // Posts the function 'fn' to target thread referred by 'context'
42
42
// 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)
44
44
// 'context' is the implementation-specific thread context object identified in a previous call
45
45
// 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;
47
47
};
48
48
49
49
// Getter/setter functions of the global ISignalThreadHelper object used by Signal::connectSlot()
@@ -89,7 +89,7 @@ class Signal : public KDBindings::Signal<Args...> {
89
89
if (emitThreadId == connectThreadId)
90
90
fnSlot (args...);
91
91
else
92
- getGlobalSignalThreadHelper ()->execInThread (threadContext, [=]{ fnSlot (args...); });
92
+ getGlobalSignalThreadHelper ()->runOnThread (threadContext, [=]{ fnSlot (args...); });
93
93
};
94
94
return this ->connect (fnWrap);
95
95
}
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ std::any QtSignalThreadHelper::getCurrentThreadContext()
18
18
return &obj;
19
19
}
20
20
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)
22
22
{
23
23
QTimer::singleShot (0 , std::any_cast<QObject*>(context), fn);
24
24
}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ namespace Mayo {
15
15
class QtSignalThreadHelper : public ISignalThreadHelper {
16
16
public:
17
17
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 ;
19
19
};
20
20
21
21
} // namespace Mayo
You can’t perform that action at this time.
0 commit comments