Index: System.Data.SQLite/SQLiteLog.cs ================================================================== --- System.Data.SQLite/SQLiteLog.cs +++ System.Data.SQLite/SQLiteLog.cs @@ -151,20 +151,14 @@ // once. // if (UnsafeNativeMethods.GetSettingValue( "Initialize_SQLiteLog", null) == null) { - try - { - if (Interlocked.Increment(ref _attemptedInitialize) > 0) - { - return; - } - } - finally + if (Interlocked.Increment(ref _attemptedInitialize) > 1) { Interlocked.Decrement(ref _attemptedInitialize); + return; } } // // BUFXIX: We cannot initialize the logging interface if the SQLite Index: lib/System.Data.SQLite/common.eagle ================================================================== --- lib/System.Data.SQLite/common.eagle +++ lib/System.Data.SQLite/common.eagle @@ -4471,10 +4471,23 @@ # # NOTE: Skip running our custom prologue if the main one has been # skipped. # if {![info exists ::no(prologue.eagle)]} then { + # + # NOTE: Save the environment variables that we intend to change for + # the test suite. + # + saveEnvironmentVariables \ + [list Initialize_SQLiteLog] ::testSuiteSavedEnv + + # + # NOTE: Force the managed logging subsystem to attempt to initialize + # itself more than once. + # + set ::env(Initialize_SQLiteLog) 1 + # # NOTE: Load the "before-constraints" custom per-user and/or per-host # test settings now. # uplevel 1 [list loadSQLiteTestSettings $::test_channel .before] @@ -5683,10 +5696,17 @@ # NOTE: If necessary, disable shared-cache mode now. # if {[hasRuntimeOption sharedCache]} then { enableSharedCache $::test_channel false } + + # + # NOTE: Restore the previously saved environment variables that we + # changed for the test suite. + # + restoreEnvironmentVariables \ + [list Initialize_SQLiteLog] ::testSuiteSavedEnv } } ########################################################################### ############################# END Eagle ONLY ##############################