From dcfff261ed687e3a25199f7adad579b95b637191 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 19 Dec 2005 02:06:56 +0000 Subject: [PATCH] use RageThreadRegister. These should be freed properly, so things still work if the driver is recreated for some reason. There may be no guarantee that the same thread will always call the I/O callback--it may recreate the thread on overload, for example ... --- stepmania/src/arch/Sound/RageSoundDriver_CA.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp b/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp index 551b4cf95e..37bb3317c1 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp @@ -33,10 +33,7 @@ static int g_iNumIOProcCalls = 0; static void NameHALThread( CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info ) { - static RageThread HALNotificationThread; - - HALNotificationThread.SetName( "HAL notification thread" ); - HALNotificationThread.CreateThisThread(); + static RageThreadRegister HALNotificationThread( "HAL notification thread" ); // Remove and release the observer CFRunLoopRef runLoopRef = CFRunLoopGetCurrent(); @@ -264,13 +261,11 @@ OSStatus RageSound_CA::GetData( AudioDeviceID inDevice, const AudioTimeStamp *inOutputTime, void *inClientData ) { - static RageThread HALIOThread; static bool bThreadCreated = false; if( !likely(bThreadCreated) ) { - HALIOThread.SetName( "HAL I/O thread" ); - HALIOThread.CreateThisThread(); + static RageThreadRegister HALNotificationThread( "HAL I/O thread" ); bThreadCreated = true; }