Fixed deadlock on stopThread and dataSourceEof not always setting currentlReadingEntry to nil
This commit is contained in:
parent
6af12221e5
commit
6beebca443
|
|
@ -2785,10 +2785,6 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
OSSpinLockLock(¤tEntryReferencesLock);
|
||||
currentlyReadingEntry = nil;
|
||||
OSSpinLockUnlock(¤tEntryReferencesLock);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2796,6 +2792,11 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
|
|||
self.internalState = AudioPlayerInternalStateStopped;
|
||||
}
|
||||
|
||||
OSSpinLockLock(¤tEntryReferencesLock);
|
||||
currentlyReadingEntry = nil;
|
||||
OSSpinLockUnlock(¤tEntryReferencesLock);
|
||||
|
||||
|
||||
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);
|
||||
}];
|
||||
|
|
|
|||
Loading…
Reference in New Issue