summaryrefslogtreecommitdiffstats
path: root/src/jogl/native
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/native')
-rw-r--r--src/jogl/native/macosx/ContextUpdater.h8
-rw-r--r--src/jogl/native/macosx/ContextUpdater.m40
2 files changed, 18 insertions, 30 deletions
diff --git a/src/jogl/native/macosx/ContextUpdater.h b/src/jogl/native/macosx/ContextUpdater.h
index 2483ec403..3cf7315af 100644
--- a/src/jogl/native/macosx/ContextUpdater.h
+++ b/src/jogl/native/macosx/ContextUpdater.h
@@ -31,10 +31,10 @@ This notification is sent whenever an NSView that has an attached NSSurface chan
BOOL viewUpdated;
}
-+ (void) lock;
-+ (void) lockInFunction:(char *)func atLine:(int)line;
-+ (void) unlock;
-+ (void) unlockInFunction:(char *)func atLine:(int)line;
+- (void) lock;
+- (void) lockInFunction:(char *)func atLine:(int)line;
+- (void) unlock;
+- (void) unlockInFunction:(char *)func atLine:(int)line;
- (id) initWithContext:(NSOpenGLContext *)context view: (NSView *)nsView;
diff --git a/src/jogl/native/macosx/ContextUpdater.m b/src/jogl/native/macosx/ContextUpdater.m
index 64d5ef1f9..21f98ad5e 100644
--- a/src/jogl/native/macosx/ContextUpdater.m
+++ b/src/jogl/native/macosx/ContextUpdater.m
@@ -13,43 +13,31 @@ static void printLockDebugInfo(char *message, char *func, int line)
fflush(NULL);
}
-+ (void) lock
+- (void) lock
{
- if (ctx != NULL)
- {
- pthread_mutex_lock(&resourceLock);
- }
+ pthread_mutex_lock(&resourceLock);
}
-+ (void) lockInFunction:(char *)func atLine:(int)line
+- (void) lockInFunction:(char *)func atLine:(int)line
{
- if (ctx != NULL)
- {
- printLockDebugInfo("locked ", func, line);
- [self lock];
- }
+ printLockDebugInfo("locked ", func, line);
+ [self lock];
}
-+ (void) unlock
+- (void) unlock
{
- if (ctx != NULL)
- {
- pthread_mutex_unlock(&resourceLock);
- }
+ pthread_mutex_unlock(&resourceLock);
}
-+ (void) unlockInFunction:(char *)func atLine:(int)line
+- (void) unlockInFunction:(char *)func atLine:(int)line
{
- if (ctx != NULL)
- {
- printLockDebugInfo("unlocked", func, line);
- [self unlock];
- }
+ printLockDebugInfo("unlocked", func, line);
+ [self unlock];
}
- (void) update:(NSNotification *)notification
{
- [ContextUpdater lock];
+ [self lock];
NSRect r = [view frame];
if(viewRect.origin.x != r.origin.x ||
@@ -60,18 +48,18 @@ static void printLockDebugInfo(char *message, char *func, int line)
viewRect = r;
}
- [ContextUpdater unlock];
+ [self unlock];
}
- (BOOL) needsUpdate
{
BOOL r;
- [ContextUpdater lock];
+ [self lock];
r = viewUpdated;
viewUpdated = FALSE;
- [ContextUpdater unlock];
+ [self unlock];
return r;
}