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 Unified Diffs Ignore Whitespace Patch

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

3534
3535
3536
3537
3538
3539
3540



3541

3542

3543
3544
3545
3546
3547
3548
3549
            //
            DateTime now = DateTime.UtcNow;
            TimeSpan elapsed = now.Subtract(start);

            //
            // NOTE: Are we done wait?
            //



            if (elapsed.TotalMilliseconds >= (double)timeoutMilliseconds)

                return false;


            //
            // NOTE: Sleep for a bit and then try again.
            //
            Thread.Sleep(sleepMilliseconds);
        }
    }







>
>
>
|
>

>







3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
            //
            DateTime now = DateTime.UtcNow;
            TimeSpan elapsed = now.Subtract(start);

            //
            // NOTE: Are we done wait?
            //
            double totalMilliseconds = elapsed.TotalMilliseconds;

            if ((totalMilliseconds < 0) || /* Time went backward? */
                (totalMilliseconds >= (double)timeoutMilliseconds))
            {
                return false;
            }

            //
            // NOTE: Sleep for a bit and then try again.
            //
            Thread.Sleep(sleepMilliseconds);
        }
    }