diff options
author | Vitaly Novichkov <admin@wohlnet.ru> | 2019-07-02 00:39:42 +0300 |
---|---|---|
committer | Vitaly Novichkov <admin@wohlnet.ru> | 2019-07-02 00:39:42 +0300 |
commit | 2049fb0a387b627a2c63442ea34973f4864533c4 (patch) | |
tree | 3015f9451681f2f7fe323fc46a0f32f52e753f06 /src/chips/dosbox/dbopl.cpp | |
parent | c24e8ff891a353f37a2d6bf7bbd670e8fdd11927 (diff) | |
parent | 64b4770fe1f552f7530f2144a8b33175e179051a (diff) | |
download | libADLMIDI-2049fb0a387b627a2c63442ea34973f4864533c4.tar.gz libADLMIDI-2049fb0a387b627a2c63442ea34973f4864533c4.tar.bz2 libADLMIDI-2049fb0a387b627a2c63442ea34973f4864533c4.zip |
Merge branch 'wip-new-embedded-banks' of git@github.com:Wohlstand/libADLMIDI.git into wip-new-embedded-banks
Diffstat (limited to 'src/chips/dosbox/dbopl.cpp')
-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 ) { |