File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,9 @@ Core and Builtins
5555Library
5656-------
5757
58+ - Issue #11408: In threading.Lock.acquire(), only call gettimeofday() when
59+ really necessary. Patch by Charles-François Natali.
60+
5861- Issue #11391: Writing to a mmap object created with
5962 ``mmap.PROT_READ|mmap.PROT_EXEC`` would segfault instead of raising a
6063 TypeError. Patch by Charles-François Natali.
Original file line number Diff line number Diff line change @@ -54,8 +54,8 @@ acquire_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds)
5454 _PyTime_timeval endtime ;
5555
5656
57- _PyTime_gettimeofday (& endtime );
5857 if (microseconds > 0 ) {
58+ _PyTime_gettimeofday (& endtime );
5959 endtime .tv_sec += microseconds / (1000 * 1000 );
6060 endtime .tv_usec += microseconds % (1000 * 1000 );
6161 }
@@ -76,7 +76,7 @@ acquire_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds)
7676
7777 /* If we're using a timeout, recompute the timeout after processing
7878 * signals, since those can take time. */
79- if (microseconds >= 0 ) {
79+ if (microseconds > 0 ) {
8080 _PyTime_gettimeofday (& curtime );
8181 microseconds = ((endtime .tv_sec - curtime .tv_sec ) * 1000000 +
8282 (endtime .tv_usec - curtime .tv_usec ));
You can’t perform that action at this time.
0 commit comments