00001 #include "util-osx-cocoa.h"
00002 #import <Cocoa/Cocoa.h>
00003
00004
00005 @implementation NSThread (Dummy)
00006
00007 - (void) run;
00008 {
00009 }
00010
00011 @end
00012
00013 void *CreateOSXCocoaPool(void)
00014 {
00015
00016
00017
00018 if (![NSThread isMultiThreaded])
00019 {
00020 NSThread *thr = [[NSThread alloc] init];
00021 SEL threadSelector = @selector(run);
00022 [NSThread detachNewThreadSelector:threadSelector
00023 toTarget:thr
00024 withObject:nil];
00025 }
00026
00027 NSAutoreleasePool *pool = NULL;
00028 pool = [[NSAutoreleasePool alloc] init];
00029 return pool;
00030 }
00031
00032 void DeleteOSXCocoaPool(void* &pool)
00033 {
00034 if (pool)
00035 {
00036 NSAutoreleasePool *a_pool = (NSAutoreleasePool*) pool;
00037 pool = NULL;
00038 [a_pool release];
00039 }
00040 }