aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorLionel Ulmer2002-05-07 21:42:51 +0000
committerLionel Ulmer2002-05-07 21:42:51 +0000
commite08b53ce9c1e42a522ab177c9d889c552ca5be83 (patch)
treebaccc785e3afa434730cf9a79f414aaf6920fc5d /sound
parentda4a7961da381082b5f724e84cab65cf6ce75807 (diff)
downloadscummvm-rg350-e08b53ce9c1e42a522ab177c9d889c552ca5be83.tar.gz
scummvm-rg350-e08b53ce9c1e42a522ab177c9d889c552ca5be83.tar.bz2
scummvm-rg350-e08b53ce9c1e42a522ab177c9d889c552ca5be83.zip
Fix a (very rare outside of running with GDB) race condition between
thread start and the parameters used by the thread. svn-id: r4230
Diffstat (limited to 'sound')
-rw-r--r--sound/imuse.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/imuse.cpp b/sound/imuse.cpp
index f702c7cedb..70a1ff3508 100644
--- a/sound/imuse.cpp
+++ b/sound/imuse.cpp
@@ -4249,7 +4249,7 @@ int IMuseGM::midi_driver_thread(void *param) {
for(;;) {
mid->_system->delay_msecs(10);
-
+
cur_time = mid->_system->get_msecs();
while (old_time < cur_time) {
old_time += 10;
@@ -4318,8 +4318,8 @@ void IMuseGM::init(IMuseInternal *eng, OSystem *syst)
error("IMuseGM::error = %s", MidiDriver::get_error_name(result));
/* Install the on_timer thread */
- syst->create_thread(midi_driver_thread, this);
_se = eng;
+ syst->create_thread(midi_driver_thread, this);
for (i = 0, mc = _midi_channels; i != ARRAYSIZE(_midi_channels); i++, mc++)
mc->_chan = i;