OpenCoverage

qqmlthread_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/ftw/qqmlthread_p.h
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5class QThread;-
6class QMutex;-
7-
8class QQmlThreadPrivate;-
9class QQmlThread-
10{-
11public:-
12 QQmlThread();-
13 virtual ~QQmlThread();-
14-
15 void startup();-
16 void shutdown();-
17 bool isShutdown() const;-
18-
19 QMutex &mutex();-
20 void lock();-
21 void unlock();-
22 void wakeOne();-
23 void wakeAll();-
24 void wait();-
25-
26 QThread *thread() const;-
27 bool isThisThread() const;-
28-
29-
30 template<class O>-
31 inline void callMethodInThread(void (O::*Member)());-
32 template<typename T, class V, class O>-
33 inline void callMethodInThread(void (O::*Member)(V), const T &);-
34 template<typename T, typename T2, class V, class V2, class O>-
35 inline void callMethodInThread(void (O::*Member)(V, V2), const T &, const T2 &);-
36-
37-
38-
39-
40 template<class O>-
41 inline void callMethodInMain(void (O::*Member)());-
42 template<typename T, class V, class O>-
43 inline void callMethodInMain(void (O::*Member)(V), const T &);-
44 template<typename T, typename T2, class V, class V2, class O>-
45 inline void callMethodInMain(void (O::*Member)(V, V2), const T &, const T2 &);-
46-
47-
48 template<class O>-
49 inline void postMethodToThread(void (O::*Member)());-
50 template<typename T, class V, class O>-
51 inline void postMethodToThread(void (O::*Member)(V), const T &);-
52 template<typename T, typename T2, class V, class V2, class O>-
53 inline void postMethodToThread(void (O::*Member)(V, V2), const T &, const T2 &);-
54-
55-
56 template<class O>-
57 inline void postMethodToMain(void (O::*Member)());-
58 template<typename T, class V, class O>-
59 inline void postMethodToMain(void (O::*Member)(V), const T &);-
60 template<typename T, typename T2, class V, class V2, class O>-
61 inline void postMethodToMain(void (O::*Member)(V, V2), const T &, const T2 &);-
62-
63 void waitForNextMessage();-
64-
65protected:-
66 virtual void startupThread();-
67 virtual void shutdownThread();-
68-
69private:-
70 friend class QQmlThreadPrivate;-
71-
72 struct Message {-
73 Message() : next(nullptr) {}
executed 117437 times by 141 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
117437
74 virtual ~Message() {}-
75 Message *next;-
76 virtual void call(QQmlThread *) = 0;-
77 };-
78 void internalCallMethodInThread(Message *);-
79 void internalCallMethodInMain(Message *);-
80 void internalPostMethodToThread(Message *);-
81 void internalPostMethodToMain(Message *);-
82 QQmlThreadPrivate *d;-
83};-
84-
85template<class O>-
86void QQmlThread::callMethodInThread(void (O::*Member)())-
87{-
88 struct I : public Message {-
89 void (O::*Member)();-
90 I(void (O::*Member)()) : Member(Member) {}
never executed: end of block
0
91 void call(QQmlThread *thread) override {-
92 O *me = static_cast<O *>(thread);-
93 (me->*Member)();-
94 }
never executed: end of block
0
95 };-
96 internalCallMethodInThread(new I(Member));-
97}
never executed: end of block
0
98-
99template<typename T, class V, class O>-
100void QQmlThread::callMethodInThread(void (O::*Member)(V), const T &arg)-
101{-
102 struct I : public Message {-
103 void (O::*Member)(V);-
104 T arg;-
105 I(void (O::*Member)(V), const T &arg) : Member(Member), arg(arg) {}
executed 8500 times by 126 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • ...
8500
106 void call(QQmlThread *thread) override {-
107 O *me = static_cast<O *>(thread);-
108 (me->*Member)(arg);-
109 }
executed 8500 times by 126 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • ...
8500
110 };-
111 internalCallMethodInThread(new I(Member, arg));-
112}
executed 8500 times by 126 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmlitemmodels
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • ...
8500
113-
114template<typename T, typename T2, class V, class V2, class O>-
115void QQmlThread::callMethodInThread(void (O::*Member)(V, V2), const T &arg, const T2 &arg2)-
116{-
117 struct I : public Message {-
118 void (O::*Member)(V, V2);-
119 T arg;-
120 T2 arg2;-
121 I(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) : Member(Member), arg(arg), arg2(arg2) {}
executed 45777 times by 60 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_examples
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlimport
  • tst_qqmllistmodel
  • tst_qqmllistreference
  • tst_qqmllocale
  • tst_qqmlmoduleplugin
  • tst_qqmlnativeconnector
  • tst_qqmlnotifier
  • tst_qqmlproperty
  • tst_qqmlpropertymap
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlsqldatabase
  • tst_qqmltimer
  • ...
45777
122 void call(QQmlThread *thread) override {-
123 O *me = static_cast<O *>(thread);-
124 (me->*Member)(arg, arg2);-
125 }
executed 45777 times by 60 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_examples
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlimport
  • tst_qqmllistmodel
  • tst_qqmllistreference
  • tst_qqmllocale
  • tst_qqmlmoduleplugin
  • tst_qqmlnativeconnector
  • tst_qqmlnotifier
  • tst_qqmlproperty
  • tst_qqmlpropertymap
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlsqldatabase
  • tst_qqmltimer
  • ...
45777
126 };-
127 internalCallMethodInThread(new I(Member, arg, arg2));-
128}
executed 45777 times by 60 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_examples
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlimport
  • tst_qqmllistmodel
  • tst_qqmllistreference
  • tst_qqmllocale
  • tst_qqmlmoduleplugin
  • tst_qqmlnativeconnector
  • tst_qqmlnotifier
  • tst_qqmlproperty
  • tst_qqmlpropertymap
  • tst_qqmlqt
  • tst_qqmlsettings
  • tst_qqmlsqldatabase
  • tst_qqmltimer
  • ...
45777
129-
130template<class O>-
131void QQmlThread::callMethodInMain(void (O::*Member)())-
132{-
133 struct I : public Message {-
134 void (O::*Member)();-
135 I(void (O::*Member)()) : Member(Member) {}
never executed: end of block
0
136 void call(QQmlThread *thread) override {-
137 O *me = static_cast<O *>(thread);-
138 (me->*Member)();-
139 }
never executed: end of block
0
140 };-
141 internalCallMethodInMain(new I(Member));-
142}
never executed: end of block
0
143-
144template<typename T, class V, class O>-
145void QQmlThread::callMethodInMain(void (O::*Member)(V), const T &arg)-
146{-
147 struct I : public Message {-
148 void (O::*Member)(V);-
149 T arg;-
150 I(void (O::*Member)(V), const T &arg) : Member(Member), arg(arg) {}
never executed: end of block
0
151 void call(QQmlThread *thread) override {-
152 O *me = static_cast<O *>(thread);-
153 (me->*Member)(arg);-
154 }
never executed: end of block
0
155 };-
156 internalCallMethodInMain(new I(Member, arg));-
157}
never executed: end of block
0
158-
159template<typename T, typename T2, class V, class V2, class O>-
160void QQmlThread::callMethodInMain(void (O::*Member)(V, V2), const T &arg, const T2 &arg2)-
161{-
162 struct I : public Message {-
163 void (O::*Member)(V, V2);-
164 T arg;-
165 T2 arg2;-
166 I(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) : Member(Member), arg(arg), arg2(arg2) {}
executed 7389 times by 135 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • ...
7389
167 void call(QQmlThread *thread) override {-
168 O *me = static_cast<O *>(thread);-
169 (me->*Member)(arg, arg2);-
170 }
executed 7389 times by 135 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • ...
7389
171 };-
172 internalCallMethodInMain(new I(Member, arg, arg2));-
173}
executed 7389 times by 135 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • ...
7389
174-
175template<class O>-
176void QQmlThread::postMethodToThread(void (O::*Member)())-
177{-
178 struct I : public Message {-
179 void (O::*Member)();-
180 I(void (O::*Member)()) : Member(Member) {}
never executed: end of block
0
181 void call(QQmlThread *thread) override {-
182 O *me = static_cast<O *>(thread);-
183 (me->*Member)();-
184 }
never executed: end of block
0
185 };-
186 internalPostMethodToThread(new I(Member));-
187}
never executed: end of block
0
188-
189template<typename T, class V, class O>-
190void QQmlThread::postMethodToThread(void (O::*Member)(V), const T &arg)-
191{-
192 struct I : public Message {-
193 void (O::*Member)(V);-
194 T arg;-
195 I(void (O::*Member)(V), const T &arg) : Member(Member), arg(arg) {}
executed 104 times by 8 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlcomponent
  • tst_qqmlenginecleanup
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickloader
104
196 void call(QQmlThread *thread) override {-
197 O *me = static_cast<O *>(thread);-
198 (me->*Member)(arg);-
199 }
executed 104 times by 8 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlcomponent
  • tst_qqmlenginecleanup
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickloader
104
200 };-
201 internalPostMethodToThread(new I(Member, arg));-
202}
executed 104 times by 8 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlcomponent
  • tst_qqmlenginecleanup
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickloader
104
203-
204template<typename T, typename T2, class V, class V2, class O>-
205void QQmlThread::postMethodToThread(void (O::*Member)(V, V2), const T &arg, const T2 &arg2)-
206{-
207 struct I : public Message {-
208 void (O::*Member)(V, V2);-
209 T arg;-
210 T2 arg2;-
211 I(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) : Member(Member), arg(arg), arg2(arg2) {}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qmlcachegen
6
212 void call(QQmlThread *thread) override {-
213 O *me = static_cast<O *>(thread);-
214 (me->*Member)(arg, arg2);-
215 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qmlcachegen
6
216 };-
217 internalPostMethodToThread(new I(Member, arg, arg2));-
218}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qmlcachegen
6
219-
220template<class O>-
221void QQmlThread::postMethodToMain(void (O::*Member)())-
222{-
223 struct I : public Message {-
224 void (O::*Member)();-
225 I(void (O::*Member)()) : Member(Member) {}
never executed: end of block
0
226 void call(QQmlThread *thread) override {-
227 O *me = static_cast<O *>(thread);-
228 (me->*Member)();-
229 }
never executed: end of block
0
230 };-
231 internalPostMethodToMain(new I(Member));-
232}
never executed: end of block
0
233-
234template<typename T, class V, class O>-
235void QQmlThread::postMethodToMain(void (O::*Member)(V), const T &arg)-
236{-
237 struct I : public Message {-
238 void (O::*Member)(V);-
239 T arg;-
240 I(void (O::*Member)(V), const T &arg) : Member(Member), arg(arg) {}
executed 55543 times by 141 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
55543
241 void call(QQmlThread *thread) override {-
242 O *me = static_cast<O *>(thread);-
243 (me->*Member)(arg);-
244 }
executed 55541 times by 141 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
55541
245 };-
246 internalPostMethodToMain(new I(Member, arg));-
247}
executed 55543 times by 141 tests: end of block
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
55543
248-
249template<typename T, typename T2, class V, class V2, class O>-
250void QQmlThread::postMethodToMain(void (O::*Member)(V, V2), const T &arg, const T2 &arg2)-
251{-
252 struct I : public Message {-
253 void (O::*Member)(V, V2);-
254 T arg;-
255 T2 arg2;-
256 I(void (O::*Member)(V, V2), const T &arg, const T2 &arg2) : Member(Member), arg(arg), arg2(arg2) {}
executed 118 times by 11 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlcomponent
  • tst_qqmlenginecleanup
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickanimatedimage
  • tst_qquickloader
  • tst_qquicktextedit
  • tst_qquicktextinput
118
257 void call(QQmlThread *thread) override {-
258 O *me = static_cast<O *>(thread);-
259 (me->*Member)(arg, arg2);-
260 }
executed 118 times by 11 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlcomponent
  • tst_qqmlenginecleanup
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickanimatedimage
  • tst_qquickloader
  • tst_qquicktextedit
  • tst_qquicktextinput
118
261 };-
262 internalPostMethodToMain(new I(Member, arg, arg2));-
263}
executed 118 times by 11 tests: end of block
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlcomponent
  • tst_qqmlenginecleanup
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qquickanimatedimage
  • tst_qquickloader
  • tst_qquicktextedit
  • tst_qquicktextinput
118
264-
265-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0