Closed vincentyanzhao closed 2 years ago
While the main waiting is done in the CVAR the lock is unlocked and the CVAR is awaiting for the signaling state
The woken executor thread will check for a few conditions (like spurious wake ups) and will handle the task. NOTE: the tasks have to be "prompt"
Describe the bug
After the thread functiontimer QueueExecutor starts calling the lock for the first time, it enters a long wait; Other threads calling the API will deadlock; I encountered this situation in my own program;But there are no problems in the demo. It's strange !!!!
SDK version number the SDK version commit d10936c70ef00941226f431b9bda46eca5aa2f0a
Expected behavior I think that once the thread function QueueExecutor is locked by pTimerQueue->executorLock , other threads call API ,it will deadlock by pTimerQueue->executorLock; Example timerQueueCancelTimer
Screenshots PVOID timerQueueExecutor(PVOID args) { .... MUTEX_LOCK(pTimerQueue->executorLock); locked = TRUE; // The main loop while (!ATOMIC_LOAD_BOOL(&pTimerQueue->shutdown)) { // Block/wait until signaled or timed out curTime = GETTIME(); if (curTime < pTimerQueue->invokeTime) { CVAR_WAIT(pTimerQueue->executorCvar, pTimerQueue->executorLock, pTimerQueue->invokeTime - curTime); } .... }
.... }
Desktop (please complete the following information):