Merge "Try to determine renderable format in lifetime tests am: c0a5dc217f am: e94af4...
[platform/upstream/VK-GL-CTS.git] / framework / qphelper / qpWatchDog.c
index 84957b8..c691aa2 100644 (file)
@@ -69,11 +69,14 @@ static void watchDogThreadFunc (void* arg)
                deUint64        curTime                                 = deGetMicroseconds();
                int                     totalSecondsPassed              = (int)((curTime - dog->resetTime) / 1000000ull);
                int                     secondsSinceLastTouch   = (int)((curTime - dog->lastTouchTime) / 1000000ull);
+               deBool          overIntervalLimit               = secondsSinceLastTouch > dog->intervalTimeLimit;
+               deBool          overTotalLimit                  = totalSecondsPassed > dog->totalTimeLimit;
 
-               if ((secondsSinceLastTouch > dog->intervalTimeLimit) || (totalSecondsPassed > dog->totalTimeLimit))
+               if (overIntervalLimit || overTotalLimit)
                {
+                   qpTimeoutReason reason = overTotalLimit ? QP_TIMEOUT_REASON_TOTAL_LIMIT : QP_TIMEOUT_REASON_INTERVAL_LIMIT;
                        DBGPRINT(("watchDogThreadFunc(): call timeout func\n"));
-                       dog->timeOutFunc(dog, dog->timeOutUserPtr);
+                       dog->timeOutFunc(dog, dog->timeOutUserPtr, reason);
                        break;
                }