From 1f24ab07424dda05d83bf3dca688bb3d21fcef85 Mon Sep 17 00:00:00 2001 From: Quantum Date: Mon, 27 Sep 2021 03:06:25 -0400 Subject: [PATCH] [host] nvfbc: avoid waking up pointer thread for no reason If the wait times out, we used to simply restart the loop, which causes it to check this->stop and exit if set to true. However, nvfbc_stop already calls lgSignalEvent, which would wake up the pointer thread to perform the check, so there is no need to set a timeout on the wait. --- host/platform/Windows/capture/NVFBC/src/nvfbc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/host/platform/Windows/capture/NVFBC/src/nvfbc.c b/host/platform/Windows/capture/NVFBC/src/nvfbc.c index b0407b44..bacead15 100644 --- a/host/platform/Windows/capture/NVFBC/src/nvfbc.c +++ b/host/platform/Windows/capture/NVFBC/src/nvfbc.c @@ -573,10 +573,9 @@ static CaptureResult nvfbc_getFrame(FrameBuffer * frame, static int pointerThread(void * unused) { - while(!this->stop) + while (!this->stop) { - if (!lgWaitEvent(this->cursorEvent, 1000)) - continue; + lgWaitEvent(this->cursorEvent, TIMEOUT_INFINITE); if (this->stop) break;