diff options
author | John Barboza <jbarboza@ca.ibm.com> | 2018-01-17 10:30:48 -0500 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2018-02-15 16:15:23 +0100 |
commit | 1ded66908dba4fbd11e68471afbba17ac18361cd (patch) | |
tree | 2608c5bc3ba18a4c3962f16c40ff8351b1a3d89c /docs/src | |
parent | 95e44dd46e5e2ae146a367759a6830eb51d49fc7 (diff) | |
download | libuv-1ded66908dba4fbd11e68471afbba17ac18361cd.tar.gz libuv-1ded66908dba4fbd11e68471afbba17ac18361cd.zip |
zos: fix timeout for condition variable
The pthread_cond_timedwait requires a timeout relative to the Epoch.
So don't use uv__hrtime to set the timeout because it is relative to an
arbitrary time in the past. Use gettimeofday instead.
PR-URL: https://github.com/libuv/libuv/pull/1711
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jamie Davis <davisjam@vt.edu>
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/threading.rst | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/docs/src/threading.rst b/docs/src/threading.rst index bca8ba1d..89bb4a6f 100644 --- a/docs/src/threading.rst +++ b/docs/src/threading.rst @@ -131,8 +131,15 @@ Functions return 0 on success or an error code < 0 (unless the return type is void, of course). .. note:: - Callers should be prepared to deal with spurious wakeups on :c:func:`uv_cond_wait` and - :c:func:`uv_cond_timedwait`. + 1. Callers should be prepared to deal with spurious wakeups on :c:func:`uv_cond_wait` + and :c:func:`uv_cond_timedwait`. + 2. The timeout parameter for :c:func:`uv_cond_timedwait` is relative to the time + at which function is called. + 3. On z/OS, the timeout parameter for :c:func:`uv_cond_timedwait` is converted to an + absolute system time at which the wait expires. If the current system clock time + passes the absolute time calculated before the condition is signaled, an ETIMEDOUT + error results. After the wait begins, the wait time is not affected by changes + to the system clock. .. c:function:: int uv_cond_init(uv_cond_t* cond) .. c:function:: void uv_cond_destroy(uv_cond_t* cond) |