Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(546)

Unified Diff: Modules/_threadmodule.c

Issue 22043: Use a monotonic clock to compute timeouts
Patch Set: Created 3 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/trace.py ('k') | Modules/gcmodule.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Modules/_threadmodule.c Sun Aug 31 14:47:56 2014 +0200
+++ b/Modules/_threadmodule.c Sun Aug 31 15:02:13 2014 +0200
@@ -57,7 +57,7 @@ acquire_timed(PyThread_type_lock lock, P
if (microseconds > 0) {
- _PyTime_gettimeofday(&endtime);
+ _PyTime_monotonic(&endtime);
endtime.tv_sec += microseconds / (1000 * 1000);
endtime.tv_usec += microseconds % (1000 * 1000);
}
@@ -83,7 +83,7 @@ acquire_timed(PyThread_type_lock lock, P
/* If we're using a timeout, recompute the timeout after processing
* signals, since those can take time. */
if (microseconds > 0) {
- _PyTime_gettimeofday(&curtime);
+ _PyTime_monotonic(&curtime);
microseconds = ((endtime.tv_sec - curtime.tv_sec) * 1000000 +
(endtime.tv_usec - curtime.tv_usec));
« no previous file with comments | « Lib/trace.py ('k') | Modules/gcmodule.c » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7