mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Fix broken timeout calculation causing intermittent CI failures
* It turns out that min(0, x) is 0, and not a great way to prevent underflow!
This commit is contained in:
@@ -129,7 +129,10 @@ Socket *Socket::AcceptClient(uint32_t timeoutMilliseconds)
|
||||
|
||||
Threading::Sleep(sleeptime);
|
||||
|
||||
timeoutMilliseconds = RDCMIN(0U, timeoutMilliseconds - sleeptime);
|
||||
if(sleeptime < timeoutMilliseconds)
|
||||
timeoutMilliseconds -= sleeptime;
|
||||
else
|
||||
timeoutMilliseconds = 0U;
|
||||
} while(timeoutMilliseconds);
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -144,7 +144,10 @@ Socket *Socket::AcceptClient(uint32_t timeoutMilliseconds)
|
||||
|
||||
Threading::Sleep(sleeptime);
|
||||
|
||||
timeoutMilliseconds = RDCMIN(0U, timeoutMilliseconds - sleeptime);
|
||||
if(sleeptime < timeoutMilliseconds)
|
||||
timeoutMilliseconds -= sleeptime;
|
||||
else
|
||||
timeoutMilliseconds = 0U;
|
||||
} while(timeoutMilliseconds);
|
||||
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user