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()
73 …if ((secondsSinceLastTouch > dog->intervalTimeLimit) || (totalSecondsPassed > dog->totalTimeLimit)) in watchDogThreadFunc()
76 dog->timeOutFunc(dog, dog->timeOutUserPtr); in watchDogThreadFunc()
89 qpWatchDog* dog = (qpWatchDog*)deCalloc(sizeof(qpWatchDog)); in qpWatchDog_create() local
90 if (!dog) in qpWatchDog_create()
91 return dog; in qpWatchDog_create()
98 dog->timeOutFunc = timeOutFunc; in qpWatchDog_create()
99 dog->timeOutUserPtr = userPtr; in qpWatchDog_create()
100 dog->totalTimeLimit = totalTimeLimitSecs; in qpWatchDog_create()
101 dog->intervalTimeLimit = intervalTimeLimitSecs; in qpWatchDog_create()
104 qpWatchDog_reset(dog); in qpWatchDog_create()
107 dog->status = STATUS_THREAD_RUNNING; in qpWatchDog_create()
108 dog->watchDogThread = deThread_create(watchDogThreadFunc, dog, DE_NULL); in qpWatchDog_create()
109 if (!dog->watchDogThread) in qpWatchDog_create()
111 deFree(dog); in qpWatchDog_create()
115 return dog; in qpWatchDog_create()
118 void qpWatchDog_reset (qpWatchDog* dog) in qpWatchDog_reset() argument
122 DE_ASSERT(dog); in qpWatchDog_reset()
125 dog->resetTime = curTime; in qpWatchDog_reset()
126 dog->lastTouchTime = curTime; in qpWatchDog_reset()
129 void qpWatchDog_destroy (qpWatchDog* dog) in qpWatchDog_destroy() argument
131 DE_ASSERT(dog); in qpWatchDog_destroy()
135 dog->status = STATUS_STOP_THREAD; in qpWatchDog_destroy()
136 deThread_join(dog->watchDogThread); in qpWatchDog_destroy()
137 deThread_destroy(dog->watchDogThread); in qpWatchDog_destroy()
140 deFree(dog); in qpWatchDog_destroy()
143 void qpWatchDog_touch (qpWatchDog* dog) in qpWatchDog_touch() argument
145 DE_ASSERT(dog); in qpWatchDog_touch()
147 dog->lastTouchTime = deGetMicroseconds(); in qpWatchDog_touch()