aboutsummaryrefslogtreecommitdiff
path: root/src/core/thread.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-01-16 23:18:46 -0800
committerGarrett D'Amore <garrett@damore.org>2017-01-16 23:22:08 -0800
commitac9236de0bc9ed3000947ef6eeeae1cd874d3071 (patch)
tree89aa198ae216bd2a6fc9a415a1fdb279e5057b1a /src/core/thread.h
parent415cf5d70ac5547664dcc471c27845bce84ad430 (diff)
downloadnng-ac9236de0bc9ed3000947ef6eeeae1cd874d3071.tar.gz
nng-ac9236de0bc9ed3000947ef6eeeae1cd874d3071.tar.bz2
nng-ac9236de0bc9ed3000947ef6eeeae1cd874d3071.zip
Windows clock fixes.
Sleep() on Win32 rounds *down*, leading to truncated timeouts. What we do is change our sleep routing to start incrementally sleeping by 1ms until the tick count is reached. This ensures we don't wake early. This problem affects condition variables too, which means that some timeouts may occur up to one clock tick early (15ish ms). This should not be a problem for most users, who should really only be setting timeouts in quantities of a second or greater.
Diffstat (limited to 'src/core/thread.h')
0 files changed, 0 insertions, 0 deletions