summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/thread/qthread_p.h')
-rw-r--r--src/corelib/thread/qthread_p.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index 73736ce13b..93f245ff6e 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -248,7 +248,15 @@ public:
void ref();
void deref();
inline bool hasEventDispatcher() const
- { return eventDispatcher.load() != 0; }
+ { return eventDispatcher.load() != nullptr; }
+ QAbstractEventDispatcher *createEventDispatcher();
+ QAbstractEventDispatcher *ensureEventDispatcher()
+ {
+ QAbstractEventDispatcher *ed = eventDispatcher.load();
+ if (Q_LIKELY(ed))
+ return ed;
+ return createEventDispatcher();
+ }
bool canWaitLocked()
{