aboutsummaryrefslogtreecommitdiff
path: root/sound/softsynth
diff options
context:
space:
mode:
authorMax Horn2005-01-28 22:05:51 +0000
committerMax Horn2005-01-28 22:05:51 +0000
commitabd12dd1b63d9e680bdc157fd5aa1fdb579e111e (patch)
treeda026a16edefcc56119ef2376eb0b26f7ec9d500 /sound/softsynth
parentc62d82450b7fc4d64bf6102cb8074457e3d0cb47 (diff)
downloadscummvm-rg350-abd12dd1b63d9e680bdc157fd5aa1fdb579e111e.tar.gz
scummvm-rg350-abd12dd1b63d9e680bdc157fd5aa1fdb579e111e.tar.bz2
scummvm-rg350-abd12dd1b63d9e680bdc157fd5aa1fdb579e111e.zip
Use class Mutex instead of MutexRef
svn-id: r16679
Diffstat (limited to 'sound/softsynth')
-rw-r--r--sound/softsynth/mt32.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/sound/softsynth/mt32.cpp b/sound/softsynth/mt32.cpp
index 44221b91b1..61c4e9ff04 100644
--- a/sound/softsynth/mt32.cpp
+++ b/sound/softsynth/mt32.cpp
@@ -378,7 +378,7 @@ public:
class MidiDriver_ThreadedMT32 : public MidiDriver_MT32 {
private:
- OSystem::MutexRef _eventMutex;
+ OSystem::Mutex _eventMutex;
MidiEvent_MT32 *_events;
Timer::TimerProc _timer_proc;
@@ -391,7 +391,6 @@ protected:
public:
MidiDriver_ThreadedMT32(SoundMixer *mixer);
- virtual ~MidiDriver_ThreadedMT32();
void onTimer();
void close();
@@ -400,15 +399,10 @@ public:
MidiDriver_ThreadedMT32::MidiDriver_ThreadedMT32(SoundMixer *mixer) : MidiDriver_MT32(mixer) {
- _eventMutex = g_system->createMutex();
_events = NULL;
_timer_proc = NULL;
}
-MidiDriver_ThreadedMT32::~MidiDriver_ThreadedMT32() {
- g_system->deleteMutex(_eventMutex);
-}
-
void MidiDriver_ThreadedMT32::close() {
MidiDriver_MT32::close();
while ((popMidiEvent() != NULL)) {
@@ -427,7 +421,7 @@ void MidiDriver_ThreadedMT32::setTimerCallback(void *timer_param, Timer::TimerPr
}
void MidiDriver_ThreadedMT32::pushMidiEvent(MidiEvent_MT32 *event) {
- g_system->lockMutex(_eventMutex);
+ Common::StackLock lock(_eventMutex);
if (_events == NULL) {
_events = event;
} else {
@@ -436,16 +430,14 @@ void MidiDriver_ThreadedMT32::pushMidiEvent(MidiEvent_MT32 *event) {
last = last->_next;
last->_next = event;
}
- g_system->unlockMutex(_eventMutex);
}
MidiEvent_MT32 *MidiDriver_ThreadedMT32::popMidiEvent() {
+ Common::StackLock lock(_eventMutex);
MidiEvent_MT32 *event;
- g_system->lockMutex(_eventMutex);
event = _events;
if (event != NULL)
_events = event->_next;
- g_system->unlockMutex(_eventMutex);
return event;
}