diff options
author | Wohlstand <admin@wohlnet.ru> | 2019-07-01 19:41:54 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2019-07-01 19:41:54 +0300 |
commit | 64b4770fe1f552f7530f2144a8b33175e179051a (patch) | |
tree | 0566abfe85f7ff843c4e637831e3b2152d2e20c8 /src | |
parent | 908c630bb1ed11ad24610b8e5174fa6d75d7b45b (diff) | |
parent | b4e56f82478d3f865af24132767e0cb8924098df (diff) | |
download | libADLMIDI-64b4770fe1f552f7530f2144a8b33175e179051a.tar.gz libADLMIDI-64b4770fe1f552f7530f2144a8b33175e179051a.tar.bz2 libADLMIDI-64b4770fe1f552f7530f2144a8b33175e179051a.zip |
Merge branch 'master' of github.com:Wohlstand/libADLMIDI into wip-new-embedded-banks
Diffstat (limited to 'src')
-rw-r--r-- | src/chips/dosbox/dbopl.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/chips/dosbox/dbopl.cpp b/src/chips/dosbox/dbopl.cpp index d1ab82f..5b4bf53 100644 --- a/src/chips/dosbox/dbopl.cpp +++ b/src/chips/dosbox/dbopl.cpp @@ -1507,11 +1507,15 @@ void Chip::Setup( Bit32u rate ) { } } -static bool doneTables = false; +static volatile bool doneTables = false; +static Mutex mutexTables; + void InitTables( void ) { if ( doneTables ) return; - doneTables = true; + MutexHolder lock( mutexTables ); + if ( doneTables ) + return; #if ( DBOPL_WAVE == WAVE_HANDLER ) || ( DBOPL_WAVE == WAVE_TABLELOG ) //Exponential volume table, same as the real adlib for ( int i = 0; i < 256; i++ ) { @@ -1661,6 +1665,7 @@ void InitTables( void ) { } } #endif + doneTables = true; } Bit32u Handler::WriteAddr( Bit32u port, Bit8u val ) { |