aboutsummaryrefslogtreecommitdiff
path: root/zencore/thread.cpp
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-11-26 15:14:00 +0100
committerMartin Ridgers <[email protected]>2021-11-26 15:17:25 +0100
commitba67259acb76741f2d690eb9e05a311c086262cf (patch)
tree667e63d1fbdc8300ce055596016485b5b8ae99d3 /zencore/thread.cpp
parentWait on an event instead of using sleep() (diff)
downloadzen-ba67259acb76741f2d690eb9e05a311c086262cf.tar.xz
zen-ba67259acb76741f2d690eb9e05a311c086262cf.zip
ProcessHandle::Wait() wasn't waiting indefinitely with a <0 timeout
Diffstat (limited to 'zencore/thread.cpp')
-rw-r--r--zencore/thread.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/zencore/thread.cpp b/zencore/thread.cpp
index ee62b5248..0f2dc7181 100644
--- a/zencore/thread.cpp
+++ b/zencore/thread.cpp
@@ -585,7 +585,7 @@ ProcessHandle::Wait(int TimeoutMs)
timespec SleepTime = { 0, SleepMs * 1000 * 1000 };
for (int i = 0; ; i += SleepMs)
{
- if (i >= TimeoutMs)
+ if (TimeoutMs >= 0 && i >= TimeoutMs)
{
return false;
}