From fd1f6a7e1f4e45f2b948302fb734fa06295b02c2 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 6 Apr 2016 19:35:53 -0400 Subject: [PATCH] Expanded on thinking. --- OSBindings/Mac/Clock Signal/Views/CSOpenGLView.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OSBindings/Mac/Clock Signal/Views/CSOpenGLView.m b/OSBindings/Mac/Clock Signal/Views/CSOpenGLView.m index 5f50e1ec8..abbdbff4b 100644 --- a/OSBindings/Mac/Clock Signal/Views/CSOpenGLView.m +++ b/OSBindings/Mac/Clock Signal/Views/CSOpenGLView.m @@ -52,10 +52,12 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt - (void)drawAtTime:(const CVTimeStamp *)now { - // Always post a -didUpdateToTime:. This is the hook upon which the substantial processing occurs. + // Always post a -openGLView:didUpdateToTime:. This is the hook upon which the substantial processing occurs. [self.delegate openGLView:self didUpdateToTime:*now]; - // Draw the display only if a previous draw is not still ongoing. + // 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. const uint32_t activityMask = 0x01; if(!OSAtomicTestAndSet(activityMask, &_updateIsOngoing)) {