diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2012-04-11 13:08:40 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-17 10:15:44 +0200 |
commit | bffbfc5b3368abaa5f95b7e4f8342e9202ab065a (patch) | |
tree | fcc07c0fde8d798287e3d870a83cd87dc4034f86 /src/plugins/platforms/cocoa/qcocoaeventdispatcher.h | |
parent | 2afeb072273bf6977b7e1897a1350cfeefa7d1b5 (diff) |
Cocoa: allow timer activation to recurse
CFRunLoopTimer's callback will never recurse. Since we are using one
CFRunLoopTimer to drive all Qt timers, we need to work around this by
sending all timers via a dedicated CFRunLoopSource (since these
callbacks can recurse). We also need to block this new timer source
along with the posted event source when calling processEvents()
"manually" to prevent livelock deep in CFRunLoop.
Change-Id: I375e46b6cfa0c76db678a1085314d42d8996d062
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaeventdispatcher.h')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaeventdispatcher.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h index a4a1286fab..f286b632fb 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h @@ -116,7 +116,6 @@ public: explicit QCocoaEventDispatcher(QObject *parent = 0); ~QCocoaEventDispatcher(); - bool processEvents(QEventLoop::ProcessEventsFlags flags); bool hasPendingEvents(); @@ -154,9 +153,11 @@ public: // timer handling QTimerInfoList timerInfoList; CFRunLoopTimerRef runLoopTimerRef; + CFRunLoopSourceRef activateTimersSourceRef; void maybeStartCFRunLoopTimer(); void maybeStopCFRunLoopTimer(); - static void activateTimer(CFRunLoopTimerRef, void *info); + static void runLoopTimerCallback(CFRunLoopTimerRef, void *info); + static void activateTimersSourceCallback(void *info); // Set 'blockSendPostedEvents' to true if you _really_ need // to make sure that qt events are not posted while calling @@ -188,8 +189,7 @@ public: int lastSerial; bool interrupt; - static Boolean postedEventSourceEqualCallback(const void *info1, const void *info2); - static void postedEventsSourcePerformCallback(void *info); + static void postedEventsSourceCallback(void *info); static void waitingObserverCallback(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info); static void firstLoopEntry(CFRunLoopObserverRef ref, CFRunLoopActivity activity, void *info); |