[Python-checkins] cpython (merge 3.5 -> default): Merge 3.5 (monotonic)

victor.stinner python-checkins at python.org
Thu Sep 3 00:16:41 CEST 2015


https://hg.python.org/cpython/rev/4396ffb6e2e7
changeset:   97599:4396ffb6e2e7
parent:      97596:b7efc37b2d7e
parent:      97598:546f02960e83
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Sep 03 00:15:23 2015 +0200
summary:
  Merge 3.5 (monotonic)

files:
  Python/pytime.c |  16 +++-------------
  1 files changed, 3 insertions(+), 13 deletions(-)


diff --git a/Python/pytime.c b/Python/pytime.c
--- a/Python/pytime.c
+++ b/Python/pytime.c
@@ -601,12 +601,8 @@
 
 
 static int
-pymonotonic_new(_PyTime_t *tp, _Py_clock_info_t *info, int raise)
+pymonotonic(_PyTime_t *tp, _Py_clock_info_t *info, int raise)
 {
-#ifdef Py_DEBUG
-    static int last_set = 0;
-    static _PyTime_t last = 0;
-#endif
 #if defined(MS_WINDOWS)
     ULONGLONG result;
 
@@ -698,12 +694,6 @@
     if (_PyTime_FromTimespec(tp, &ts, raise) < 0)
         return -1;
 #endif
-#ifdef Py_DEBUG
-    /* monotonic clock cannot go backward */
-    assert(!last_set || last <= *tp);
-    last = *tp;
-    last_set = 1;
-#endif
     return 0;
 }
 
@@ -711,7 +701,7 @@
 _PyTime_GetMonotonicClock(void)
 {
     _PyTime_t t;
-    if (pymonotonic_new(&t, NULL, 0) < 0) {
+    if (pymonotonic(&t, NULL, 0) < 0) {
         /* should not happen, _PyTime_Init() checked that monotonic clock at
            startup */
         assert(0);
@@ -725,7 +715,7 @@
 int
 _PyTime_GetMonotonicClockWithInfo(_PyTime_t *tp, _Py_clock_info_t *info)
 {
-    return pymonotonic_new(tp, info, 1);
+    return pymonotonic(tp, info, 1);
 }
 
 int

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list