summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-03-06 09:36:06 (GMT)
committerGeorg Brandl <georg@python.org>2011-03-06 09:36:06 (GMT)
commit8a1acf2e34dc109a2b01f172b05475caea32e060 (patch)
treebae5c5d20c6723b9d1c36e0e34ce46eb69f375ae /Modules
parent776e5861140957692db39fa63b6c1171ddb8508b (diff)
parent125d5c877056db5d6487f21124064bc85283843a (diff)
downloadcpython-8a1acf2e34dc109a2b01f172b05475caea32e060.zip
cpython-8a1acf2e34dc109a2b01f172b05475caea32e060.tar.gz
cpython-8a1acf2e34dc109a2b01f172b05475caea32e060.tar.bz2
merge heads
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_threadmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index 14ed55e..57d08d3 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -54,8 +54,8 @@ acquire_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds)
_PyTime_timeval endtime;
- _PyTime_gettimeofday(&endtime);
if (microseconds > 0) {
+ _PyTime_gettimeofday(&endtime);
endtime.tv_sec += microseconds / (1000 * 1000);
endtime.tv_usec += microseconds % (1000 * 1000);
}
@@ -76,7 +76,7 @@ acquire_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds)
/* If we're using a timeout, recompute the timeout after processing
* signals, since those can take time. */
- if (microseconds >= 0) {
+ if (microseconds > 0) {
_PyTime_gettimeofday(&curtime);
microseconds = ((endtime.tv_sec - curtime.tv_sec) * 1000000 +
(endtime.tv_usec - curtime.tv_usec));