diff options
| author | Martin Ridgers <[email protected]> | 2022-01-07 10:12:48 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2022-01-07 10:16:52 +0100 |
| commit | 9ea8768c0799a1670966e41d37fe01f39eccd5bc (patch) | |
| tree | f3374fefc511dc1a18a3872931418fa6680a7672 /zencore/thread.cpp | |
| parent | Corrected misleading comment (diff) | |
| download | zen-9ea8768c0799a1670966e41d37fe01f39eccd5bc.tar.xz zen-9ea8768c0799a1670966e41d37fe01f39eccd5bc.zip | |
Timeouts longer than one second wouldn't work as expected
Diffstat (limited to 'zencore/thread.cpp')
| -rw-r--r-- | zencore/thread.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zencore/thread.cpp b/zencore/thread.cpp index 0a6af0406..fc7efa2fc 100644 --- a/zencore/thread.cpp +++ b/zencore/thread.cpp @@ -373,8 +373,8 @@ NamedEvent::Wait(int TimeoutMs) } struct timeval TimeoutValue = { - .tv_sec = 0, - .tv_usec = TimeoutMs << 10, + .tv_sec = (TimeoutMs >> 10), + .tv_usec = (TimeoutMs & 0x3ff) << 10, }; struct timeval* TimeoutPtr = (TimeoutMs < 0) ? nullptr : &TimeoutValue; |