diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-09-13 13:33:29 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-09-13 15:53:17 +0000 |
commit | 2c649856d5c27a55f04f572f88bebaa142f7b1c2 (patch) | |
tree | df1e46aa22da65179b6e64a91dd83fca1a2fd080 /src/plugins | |
parent | 0d1481b4d26997bab9ab9a6200776b27b9826ba6 (diff) |
macOS: Clarify what static mutex in QCocoaGLContext is used for
Change-Id: I4af0b78dbecad40b2a73cdbdb09a8eb60efdb013
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaglcontext.mm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index f11016679a..069429796e 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -393,8 +393,10 @@ bool QCocoaGLContext::setDrawable(QPlatformSurface *surface) return true; } -// NSOpenGLContext is not re-entrant (https://openradar.appspot.com/37064579) -static QMutex s_contextMutex; +// NSOpenGLContext is not re-entrant. Even when using separate contexts per thread, +// view, and window, calls into the API will still deadlock. For more information +// see https://openradar.appspot.com/37064579 +static QMutex s_reentrancyMutex; void QCocoaGLContext::update() { @@ -403,7 +405,7 @@ void QCocoaGLContext::update() // render-loop that doesn't return to one of the outer pools. QMacAutoReleasePool pool; - QMutexLocker locker(&s_contextMutex); + QMutexLocker locker(&s_reentrancyMutex); qCInfo(lcQpaOpenGLContext) << "Updating" << m_context << "for" << m_context.view; [m_context update]; } @@ -422,7 +424,7 @@ void QCocoaGLContext::swapBuffers(QPlatformSurface *surface) return; } - QMutexLocker locker(&s_contextMutex); + QMutexLocker locker(&s_reentrancyMutex); [m_context flushBuffer]; } |