diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-06-22 21:25:16 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-06-22 21:25:16 +0000 |
| commit | d30baffb38d2ee1de16f45a78d42d99e780c3df7 (patch) | |
| tree | 42b03c45adf98a9aeb0b82d9d5095e170bc3eb83 /macosx/EmuThread.m | |
| parent | b6b2beab4846d5579514aed399d7eab56d6d02f0 (diff) | |
| download | pcsxr-d30baffb38d2ee1de16f45a78d42d99e780c3df7.tar.gz | |
Minor spacing changes.
Enable logging in the debug build.
Warn if we are passed multiple memory cards of the same type from the command line.
Add a common method to set up the emulation thread.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85489 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/EmuThread.m')
| -rwxr-xr-x | macosx/EmuThread.m | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/macosx/EmuThread.m b/macosx/EmuThread.m index 2f8c5d62..01d574d1 100755 --- a/macosx/EmuThread.m +++ b/macosx/EmuThread.m @@ -30,13 +30,13 @@ static pthread_mutex_t eventMutex; #define EMUEVENT_RESET (1<<1) #define EMUEVENT_STOP (1<<2) -static NSString * const ThreadInfo = @"PSX Emu Background thread"; - @implementation EmuThread -- (void)EmuThreadRun:(id)anObject +- (void)setUpThread { - [[NSThread currentThread] setName:ThreadInfo]; + NSAssert(![[NSThread currentThread] isEqual:[NSThread mainThread]], @"This function should not be run on the main thread!"); + + [[NSThread currentThread] setName:@"PSX Emu Background thread"]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(emuWindowDidClose:) @@ -52,6 +52,11 @@ static NSString * const ThreadInfo = @"PSX Emu Background thread"; // we shouldn't change the priority, since we might depend on subthreads //[NSThread setThreadPriority:1.0-((1.0-[NSThread threadPriority])/4.0)]; +} + +- (void)EmuThreadRun:(id)anObject +{ + [self setUpThread]; // Do processing here if (OpenPlugins() == -1) @@ -87,23 +92,8 @@ done: - (void)EmuThreadRunBios:(id)anObject { - [[NSThread currentThread] setName:ThreadInfo]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(emuWindowDidClose:) - name:@"emuWindowDidClose" object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(emuWindowWantPause:) - name:@"emuWindowWantPause" object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(emuWindowWantResume:) - name:@"emuWindowWantResume" object:nil]; - - // we shouldn't change the priority, since we might depend on subthreads - //[NSThread setThreadPriority:1.0-((1.0-[NSThread threadPriority])/4.0)]; - + [self setUpThread]; + // Do processing here if (OpenPlugins() == -1) goto done; @@ -122,7 +112,7 @@ done: - (void)dealloc { // remove all registered observers - [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; SUPERDEALLOC; } |
