Fixed deadlock on stopThread and dataSourceEof not always setting currentlReadingEntry to nil

This commit is contained in:
Thong Nguyen 2014-01-27 16:28:38 +00:00
parent 6af12221e5
commit 6beebca443
1 changed files with 6 additions and 5 deletions

View File

@ -2785,10 +2785,6 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
}
}
}
OSSpinLockLock(&currentEntryReferencesLock);
currentlyReadingEntry = nil;
OSSpinLockUnlock(&currentEntryReferencesLock);
}
else
{
@ -2796,6 +2792,11 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
self.internalState = AudioPlayerInternalStateStopped;
}
OSSpinLockLock(&currentEntryReferencesLock);
currentlyReadingEntry = nil;
OSSpinLockUnlock(&currentEntryReferencesLock);
pthread_mutex_unlock(&playerMutex);
}
@ -2920,7 +2921,7 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
[self invokeOnPlaybackThread:^
{
pthread_mutex_lock(&playerMutex);
pthread_mutex_lock(&queueBuffersMutex);
disposeWasRequested = YES;
pthread_mutex_unlock(&queueBuffersMutex);
}];