summaryrefslogtreecommitdiff
path: root/Python/condvar.h
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2014-05-17 21:05:10 -0700
committerLarry Hastings <larry@hastings.org>2014-05-17 21:05:10 -0700
commit3a260d228b32b04a88d947b887bf81759e8e5f10 (patch)
treee4a34e9cbbf877cf021ffba743ddbf54e17526b7 /Python/condvar.h
parent2110603344316d927e6d639275c12f5da78601d5 (diff)
parentb1a1ec3151155a1ae65831793b4a5b7a87d9d09f (diff)
downloadcpython-git-3a260d228b32b04a88d947b887bf81759e8e5f10.tar.gz
Merge.
Diffstat (limited to 'Python/condvar.h')
-rw-r--r--Python/condvar.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/condvar.h b/Python/condvar.h
index e022dc7938..ef818c4d4b 100644
--- a/Python/condvar.h
+++ b/Python/condvar.h
@@ -60,7 +60,7 @@
#include <pthread.h>
#define PyCOND_ADD_MICROSECONDS(tv, interval) \
-do { \
+do { /* TODO: add overflow and truncation checks */ \
tv.tv_usec += (long) interval; \
tv.tv_sec += tv.tv_usec / 1000000; \
tv.tv_usec %= 1000000; \
@@ -89,7 +89,7 @@ do { \
/* return 0 for success, 1 on timeout, -1 on error */
Py_LOCAL_INLINE(int)
-PyCOND_TIMEDWAIT(PyCOND_T *cond, PyMUTEX_T *mut, long us)
+PyCOND_TIMEDWAIT(PyCOND_T *cond, PyMUTEX_T *mut, PY_LONG_LONG us)
{
int r;
struct timespec ts;
@@ -270,9 +270,9 @@ PyCOND_WAIT(PyCOND_T *cv, PyMUTEX_T *cs)
}
Py_LOCAL_INLINE(int)
-PyCOND_TIMEDWAIT(PyCOND_T *cv, PyMUTEX_T *cs, long us)
+PyCOND_TIMEDWAIT(PyCOND_T *cv, PyMUTEX_T *cs, PY_LONG_LONG us)
{
- return _PyCOND_WAIT_MS(cv, cs, us/1000);
+ return _PyCOND_WAIT_MS(cv, cs, (DWORD)(us/1000));
}
Py_LOCAL_INLINE(int)
@@ -363,9 +363,9 @@ PyCOND_WAIT(PyCOND_T *cv, PyMUTEX_T *cs)
* 2 to indicate that we don't know.
*/
Py_LOCAL_INLINE(int)
-PyCOND_TIMEDWAIT(PyCOND_T *cv, PyMUTEX_T *cs, long us)
+PyCOND_TIMEDWAIT(PyCOND_T *cv, PyMUTEX_T *cs, PY_LONG_LONG us)
{
- return SleepConditionVariableSRW(cv, cs, us/1000, 0) ? 2 : -1;
+ return SleepConditionVariableSRW(cv, cs, (DWORD)(us/1000), 0) ? 2 : -1;
}
Py_LOCAL_INLINE(int)