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

Unified Diff: Modules/socketmodule.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 | « Modules/gcmodule.c ('k') | Modules/timemodule.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Modules/socketmodule.c Sun Aug 31 14:47:56 2014 +0200
+++ b/Modules/socketmodule.c Sun Aug 31 15:02:13 2014 +0200
@@ -680,7 +680,7 @@ internal_select(PySocketSockObject *s, i
double interval = s->sock_timeout; \
int has_timeout = s->sock_timeout > 0.0; \
if (has_timeout) { \
- _PyTime_gettimeofday(&now); \
+ _PyTime_monotonic(&now); \
deadline = now; \
_PyTime_ADD_SECONDS(deadline, s->sock_timeout); \
} \
@@ -691,7 +691,7 @@ internal_select(PySocketSockObject *s, i
if (!has_timeout || \
(!CHECK_ERRNO(EWOULDBLOCK) && !CHECK_ERRNO(EAGAIN))) \
break; \
- _PyTime_gettimeofday(&now); \
+ _PyTime_monotonic(&now); \
interval = _PyTime_INTERVAL(now, deadline); \
} \
} \
« no previous file with comments | « Modules/gcmodule.c ('k') | Modules/timemodule.c » ('j') | no next file with comments »

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