From 0592e39b81056fbaa8fcea7b4ee161565b7822e4 Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 30 Aug 2006 17:21:04 +0000 Subject: [PATCH] turns out miles isn't thread-safe --- panda/src/audiotraits/milesAudioManager.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/panda/src/audiotraits/milesAudioManager.cxx b/panda/src/audiotraits/milesAudioManager.cxx index 9fd4f00b4b..05990d7b3b 100644 --- a/panda/src/audiotraits/milesAudioManager.cxx +++ b/panda/src/audiotraits/milesAudioManager.cxx @@ -399,9 +399,15 @@ get_sound(const string& file_name, bool) { if (sd == (SoundData *)NULL) { // ...the sound was not found in the cache/pool. - _lock.release(); + + // Ideally, we should release the lock while we're performing the + // actual load, so multiple threads can be loading sounds in + // parallel. However, it appears that Miles is internally not + // thread-safe, so we can't do that. + + //_lock.release(); sd = load(path); - _lock.lock(); + //_lock.lock(); if (sd != (SoundData *)NULL) { SoundMap::const_iterator si = _sounds.find(path);