summaryrefslogtreecommitdiffstats
path: root/src/jogl/native/macosx/ContextUpdater.m
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-04-08 21:35:34 +0200
committerSven Gothel <[email protected]>2011-04-08 21:35:34 +0200
commit324b85b0cc688f85a91e84b0b6d6a0378a79bea3 (patch)
treea5acbe1630d879e80ec66c6c3a72623431c57632 /src/jogl/native/macosx/ContextUpdater.m
parente104e42ba9ecda8c4094bf4b183105a6ab719da5 (diff)
Fix TAB: Replace all TAB with 4 spaces
Diffstat (limited to 'src/jogl/native/macosx/ContextUpdater.m')
-rw-r--r--src/jogl/native/macosx/ContextUpdater.m74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/jogl/native/macosx/ContextUpdater.m b/src/jogl/native/macosx/ContextUpdater.m
index 587782c98..859697722 100644
--- a/src/jogl/native/macosx/ContextUpdater.m
+++ b/src/jogl/native/macosx/ContextUpdater.m
@@ -10,74 +10,74 @@ static pthread_mutex_t resourceLock = PTHREAD_MUTEX_INITIALIZER;
static void printLockDebugInfo(char *message, char *func, int line)
{
- fprintf(stderr, "%s in function: \"%s\" at line: %d\n", message, func, line);
- fflush(stderr);
+ fprintf(stderr, "%s in function: \"%s\" at line: %d\n", message, func, line);
+ fflush(stderr);
}
+ (void) lock
{
- if (theContext != NULL)
- {
- pthread_mutex_lock(&resourceLock);
- }
+ if (theContext != NULL)
+ {
+ pthread_mutex_lock(&resourceLock);
+ }
}
+ (void) lockInFunction:(char *)func atLine:(int)line
{
- if (theContext != NULL)
- {
- printLockDebugInfo("locked ", func, line);
- [self lock];
- }
+ if (theContext != NULL)
+ {
+ printLockDebugInfo("locked ", func, line);
+ [self lock];
+ }
}
+ (void) unlock
{
- if (theContext != NULL)
- {
- pthread_mutex_unlock(&resourceLock);
- }
+ if (theContext != NULL)
+ {
+ pthread_mutex_unlock(&resourceLock);
+ }
}
+ (void) unlockInFunction:(char *)func atLine:(int)line
{
- if (theContext != NULL)
- {
- printLockDebugInfo("unlocked", func, line);
- [self unlock];
- }
+ if (theContext != NULL)
+ {
+ printLockDebugInfo("unlocked", func, line);
+ [self unlock];
+ }
}
- (void) registerFor:(NSOpenGLContext *)context with: (NSView *)view
{
- if (view != NULL)
- {
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(update:) name:NSViewGlobalFrameDidChangeNotification object: view];
- theContext = context;
- }
+ if (view != NULL)
+ {
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(update:) name:NSViewGlobalFrameDidChangeNotification object: view];
+ theContext = context;
+ }
}
- (void) update:(NSNotification *)notification
{
- [ContextUpdater lock];
-
- [theContext update];
-
- [ContextUpdater unlock];
+ [ContextUpdater lock];
+
+ [theContext update];
+
+ [ContextUpdater unlock];
}
- (id) init
-{
- theContext = NULL;
-
- return [super init];
+{
+ theContext = NULL;
+
+ return [super init];
}
- (void) dealloc
{
- [[NSNotificationCenter defaultCenter] removeObserver:self];
-
- [super dealloc];
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+ [super dealloc];
}
@end \ No newline at end of file