System.Data.SQLite
Check-in [2ac7dd7c98]
Not logged in

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

Overview
Comment:Minor revision to the previous check-in, check for the pathological case of time going backwards while sleeping.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tkt-5cee5409f8
Files: files | file ages | folders
SHA1: 2ac7dd7c98141a998ea069bfd38b162dab985164
User & Date: mistachkin 2018-01-27 20:01:11
Context
2018-01-27
20:04
Add missing disposal check. check-in: e499efc92e user: mistachkin tags: tkt-5cee5409f8
20:01
Minor revision to the previous check-in, check for the pathological case of time going backwards while sleeping. check-in: 2ac7dd7c98 user: mistachkin tags: tkt-5cee5409f8
19:55
Add experimental WaitForEnlistmentReset method to the SQLiteConnection class. check-in: 2d7e759341 user: mistachkin tags: tkt-5cee5409f8
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

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

  3534   3534               //
  3535   3535               DateTime now = DateTime.UtcNow;
  3536   3536               TimeSpan elapsed = now.Subtract(start);
  3537   3537   
  3538   3538               //
  3539   3539               // NOTE: Are we done wait?
  3540   3540               //
  3541         -            if (elapsed.TotalMilliseconds >= (double)timeoutMilliseconds)
         3541  +            double totalMilliseconds = elapsed.TotalMilliseconds;
         3542  +
         3543  +            if ((totalMilliseconds < 0) || /* Time went backward? */
         3544  +                (totalMilliseconds >= (double)timeoutMilliseconds))
         3545  +            {
  3542   3546                   return false;
         3547  +            }
  3543   3548   
  3544   3549               //
  3545   3550               // NOTE: Sleep for a bit and then try again.
  3546   3551               //
  3547   3552               Thread.Sleep(sleepMilliseconds);
  3548   3553           }
  3549   3554       }