diff options
author | Vitaly Novichkov <admin@wohlnet.ru> | 2019-09-23 02:14:21 +0300 |
---|---|---|
committer | Vitaly Novichkov <admin@wohlnet.ru> | 2019-09-23 02:14:21 +0300 |
commit | 62a018a1338b807d325d44a512499cf31563ab26 (patch) | |
tree | 1d123547ccc047e2cdc3d078a46ad372f47ff6d7 /src/chips/dosbox/dbopl.cpp | |
parent | 795195d9fe76654ff028578a9a95876b1b92dcc1 (diff) | |
parent | 241cf3838dcb4a383302cdaa99f13347c7f52f77 (diff) | |
download | libADLMIDI-62a018a1338b807d325d44a512499cf31563ab26.tar.gz libADLMIDI-62a018a1338b807d325d44a512499cf31563ab26.tar.bz2 libADLMIDI-62a018a1338b807d325d44a512499cf31563ab26.zip |
Merge branch 'master' of github.com:Wohlstand/libADLMIDI
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 ) { |