From 3765c5fbb5a8fa6a30774bfec79f072c82e624c4 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 18 May 2016 21:45:35 -0400 Subject: [PATCH] Fixed error that would prevent an interrupting frame from ever being drawn. --- OSBindings/Mac/Clock Signal/Views/CSOpenGLView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OSBindings/Mac/Clock Signal/Views/CSOpenGLView.m b/OSBindings/Mac/Clock Signal/Views/CSOpenGLView.m index ea66b245c..087c00e97 100644 --- a/OSBindings/Mac/Clock Signal/Views/CSOpenGLView.m +++ b/OSBindings/Mac/Clock Signal/Views/CSOpenGLView.m @@ -69,7 +69,7 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt // Draw the display only if a previous draw is not still ongoing. -drawViewOnlyIfDirty: is guaranteed // to be safe to call concurrently with -openGLView:updateToTime: so there's no need to worry about // the above interrupting the below or vice versa. - if(!OSAtomicTestAndSet(drawingMask, &_updateIsOngoing) && _hasSkipped) + if(_hasSkipped && !OSAtomicTestAndSet(drawingMask, &_updateIsOngoing)) { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ [self drawViewOnlyIfDirty:YES];