Lines Matching refs:dog

62 	qpWatchDog* dog = (qpWatchDog*)arg;  in watchDogThreadFunc()  local
63 DE_ASSERT(dog); in watchDogThreadFunc()
67 while (dog->status == STATUS_THREAD_RUNNING) in watchDogThreadFunc()
70 int totalSecondsPassed = (int)((curTime - dog->resetTime) / 1000000ull); in watchDogThreadFunc()
71 int secondsSinceLastTouch = (int)((curTime - dog->lastTouchTime) / 1000000ull); in watchDogThreadFunc()
72 deBool overIntervalLimit = secondsSinceLastTouch > dog->intervalTimeLimit; in watchDogThreadFunc()
73 deBool overTotalLimit = totalSecondsPassed > dog->totalTimeLimit; in watchDogThreadFunc()
79 dog->timeOutFunc(dog, dog->timeOutUserPtr, reason); in watchDogThreadFunc()
92 qpWatchDog* dog = (qpWatchDog*)deCalloc(sizeof(qpWatchDog)); in qpWatchDog_create() local
93 if (!dog) in qpWatchDog_create()
94 return dog; in qpWatchDog_create()
101 dog->timeOutFunc = timeOutFunc; in qpWatchDog_create()
102 dog->timeOutUserPtr = userPtr; in qpWatchDog_create()
103 dog->totalTimeLimit = totalTimeLimitSecs; in qpWatchDog_create()
104 dog->intervalTimeLimit = intervalTimeLimitSecs; in qpWatchDog_create()
107 qpWatchDog_reset(dog); in qpWatchDog_create()
110 dog->status = STATUS_THREAD_RUNNING; in qpWatchDog_create()
111 dog->watchDogThread = deThread_create(watchDogThreadFunc, dog, DE_NULL); in qpWatchDog_create()
112 if (!dog->watchDogThread) in qpWatchDog_create()
114 deFree(dog); in qpWatchDog_create()
118 return dog; in qpWatchDog_create()
121 void qpWatchDog_reset (qpWatchDog* dog) in qpWatchDog_reset() argument
125 DE_ASSERT(dog); in qpWatchDog_reset()
128 dog->resetTime = curTime; in qpWatchDog_reset()
129 dog->lastTouchTime = curTime; in qpWatchDog_reset()
132 void qpWatchDog_destroy (qpWatchDog* dog) in qpWatchDog_destroy() argument
134 DE_ASSERT(dog); in qpWatchDog_destroy()
138 dog->status = STATUS_STOP_THREAD; in qpWatchDog_destroy()
139 deThread_join(dog->watchDogThread); in qpWatchDog_destroy()
140 deThread_destroy(dog->watchDogThread); in qpWatchDog_destroy()
143 deFree(dog); in qpWatchDog_destroy()
146 void qpWatchDog_touch (qpWatchDog* dog) in qpWatchDog_touch() argument
148 DE_ASSERT(dog); in qpWatchDog_touch()
150 dog->lastTouchTime = deGetMicroseconds(); in qpWatchDog_touch()