diff options
author | athrxx | 2019-08-08 14:29:40 +0200 |
---|---|---|
committer | athrxx | 2019-08-25 11:58:20 +0200 |
commit | 2a2351eb2c64363207da59df68d8ad2d733df454 (patch) | |
tree | 5888d200c94c1712bb13486744170170b5a64b67 /engines | |
parent | d097768e1fe1d070d75100808543272737dd1e11 (diff) | |
download | scummvm-rg350-2a2351eb2c64363207da59df68d8ad2d733df454.tar.gz scummvm-rg350-2a2351eb2c64363207da59df68d8ad2d733df454.tar.bz2 scummvm-rg350-2a2351eb2c64363207da59df68d8ad2d733df454.zip |
SCI: (FB01 sound driver) - get rid of mutex
- The mutex was added to avoid the triggering of the assert in backends/midi/windows.cpp, line 95. Meanwhile, this issue has been addressed differently.
- SCI does not per se require a mutex for the sound drivers. The engine is mostly thread-safe by avoiding driver calls through the main thread.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/sound/drivers/fb01.cpp | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/engines/sci/sound/drivers/fb01.cpp b/engines/sci/sound/drivers/fb01.cpp index 7f163a596e..3be7650ac8 100644 --- a/engines/sci/sound/drivers/fb01.cpp +++ b/engines/sci/sound/drivers/fb01.cpp @@ -74,8 +74,6 @@ public: void playSwitch(bool play); bool isOpen() const { return _isOpen; } - void lockMutex() { _mutex.lock(); } - void unlockMutex() { _mutex.unlock(); } const char *reportMissingFiles() { return _missingFiles; } @@ -133,7 +131,6 @@ private: int _numParts; bool _isOpen; - Common::Mutex _mutex; Channel _channels[16]; Voice _voices[kVoices]; @@ -161,7 +158,6 @@ MidiPlayer_Fb01::MidiPlayer_Fb01(SciVersion version) : MidiPlayer(version), _pla MidiPlayer_Fb01::~MidiPlayer_Fb01() { if (_driver) _driver->setTimerCallback(NULL, NULL); - Common::StackLock lock(_mutex); close(); delete _driver; } @@ -510,8 +506,6 @@ void MidiPlayer_Fb01::midiTimerCallback(void *p) { MidiPlayer_Fb01 *m = (MidiPlayer_Fb01 *)p; - m->lockMutex(); - if (!m->isOpen()) return; @@ -523,12 +517,9 @@ void MidiPlayer_Fb01::midiTimerCallback(void *p) { if (m->_timerProc) m->_timerProc(m->_timerParam); - - m->unlockMutex(); } void MidiPlayer_Fb01::setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc) { - Common::StackLock lock(_mutex); _driver->setTimerCallback(NULL, NULL); _timerParam = timer_param; @@ -640,7 +631,6 @@ int MidiPlayer_Fb01::open(ResourceManager *resMan) { void MidiPlayer_Fb01::close() { if (_driver) _driver->setTimerCallback(NULL, NULL); - Common::StackLock lock(_mutex); _isOpen = false; if (_driver) _driver->close(); |