System.Data.SQLite
Check-in [8b0d28f75a]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improve clarity of using statements in the UnsafeNativeMethods class. Also, obtain the static lock prior to touching settingReadCounts (only applies to Debug builds).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8b0d28f75a67bad54b6447ba1c437a2432d8c985
User & Date: mistachkin 2014-08-11 23:59:52
Context
2014-08-12
19:19
Add NoConvertSettings connection flag to disable querying of runtime configuration settings from within the SQLiteConvert class. Pursuant to [58ed318f2f]. check-in: 59d43c48bb user: mistachkin tags: trunk
2014-08-11
23:59
Improve clarity of using statements in the UnsafeNativeMethods class. Also, obtain the static lock prior to touching settingReadCounts (only applies to Debug builds). check-in: 8b0d28f75a user: mistachkin tags: trunk
2014-08-08
21:42
Apparently, using nullable value types in DbConnectionStringBuilder derived classes can cause issues; therefore, avoid it. check-in: 29c37848ff user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/UnsafeNativeMethods.cs.

    10     10     using System;
    11     11     using System.Globalization;
    12     12   
    13     13   #if !NET_COMPACT_20 && (TRACE_DETECTION || TRACE_SHARED || TRACE_PRELOAD || TRACE_HANDLE)
    14     14     using System.Diagnostics;
    15     15   #endif
    16     16   
    17         -#if PRELOAD_NATIVE_LIBRARY
    18     17     using System.Collections.Generic;
    19     18     using System.IO;
    20     19     using System.Reflection;
    21         -#endif
    22     20   
    23     21   #if !PLATFORM_COMPACTFRAMEWORK && !DEBUG
    24     22     using System.Security;
    25     23   #endif
    26     24   
    27     25     using System.Runtime.InteropServices;
    28     26   
................................................................................
   270    268             if (name == null)
   271    269                 return @default;
   272    270   
   273    271             /////////////////////////////////////////////////////////////////////
   274    272   
   275    273             #region Debug Build Only
   276    274   #if DEBUG
   277         -          //
   278         -          // NOTE: Update statistics for this setting value.
   279         -          //
   280         -          if (settingReadCounts != null)
          275  +          lock (staticSyncRoot)
   281    276             {
   282         -              int count;
          277  +              //
          278  +              // NOTE: Update statistics for this setting value.
          279  +              //
          280  +              if (settingReadCounts != null)
          281  +              {
          282  +                  int count;
   283    283   
   284         -              if (settingReadCounts.TryGetValue(name, out count))
   285         -                  settingReadCounts[name] = count + 1;
   286         -              else
   287         -                  settingReadCounts.Add(name, 1);
          284  +                  if (settingReadCounts.TryGetValue(name, out count))
          285  +                      settingReadCounts[name] = count + 1;
          286  +                  else
          287  +                      settingReadCounts.Add(name, 1);
          288  +              }
   288    289             }
   289    290   #endif
   290    291             #endregion
   291    292   
   292    293             /////////////////////////////////////////////////////////////////////
   293    294   
   294    295             string value = null;