aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage
diff options
context:
space:
mode:
authorPaul Gilbert2011-08-01 19:33:04 +1000
committerPaul Gilbert2011-08-01 19:33:04 +1000
commit61472ad2c590a34979a8366bcd7f5db46c54afc6 (patch)
tree3dd945779aa5b002e551cde0b80478d4c080f516 /engines/tsage
parent5e726f604316d31695dbf289870abfef08c8b9b9 (diff)
downloadscummvm-rg350-61472ad2c590a34979a8366bcd7f5db46c54afc6.tar.gz
scummvm-rg350-61472ad2c590a34979a8366bcd7f5db46c54afc6.tar.bz2
scummvm-rg350-61472ad2c590a34979a8366bcd7f5db46c54afc6.zip
TSAGE: Shift mutex locking to resolve a deadlock issue
Diffstat (limited to 'engines/tsage')
-rw-r--r--engines/tsage/sound.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index 69ac426964..e47a0ed572 100644
--- a/engines/tsage/sound.cpp
+++ b/engines/tsage/sound.cpp
@@ -360,9 +360,6 @@ void SoundManager::rethinkVoiceTypes() {
}
void SoundManager::_sfSoundServer() {
- Common::StackLock slock1(sfManager()._serverDisabledMutex);
- Common::StackLock slock2(sfManager()._serverSuspendedMutex);
-
if (sfManager()._needToRethink) {
_sfRethinkVoiceTypes();
sfManager()._needToRethink = false;
@@ -2760,6 +2757,9 @@ void AdlibSoundDriver::setFrequency(int channel) {
}
int AdlibSoundDriver::readBuffer(int16 *buffer, const int numSamples) {
+ Common::StackLock slock1(SoundManager::sfManager()._serverDisabledMutex);
+ Common::StackLock slock2(SoundManager::sfManager()._serverSuspendedMutex);
+
int32 samplesLeft = numSamples;
memset(buffer, 0, sizeof(int16) * numSamples);
while (samplesLeft) {