From e4498df607507cd0b19e9689e5a93fd25c595709 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 15 Apr 2024 09:52:21 +0200 Subject: [PATCH] [coverity] 1543089 Data race condition --- winpr/libwinpr/synch/timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winpr/libwinpr/synch/timer.c b/winpr/libwinpr/synch/timer.c index 6296c6b62..354382c95 100644 --- a/winpr/libwinpr/synch/timer.c +++ b/winpr/libwinpr/synch/timer.c @@ -881,12 +881,13 @@ static void* TimerQueueThread(void* arg) status = pthread_cond_timedwait(&(timerQueue->cond), &(timerQueue->cond_mutex), &timeout); FireExpiredTimerQueueTimers(timerQueue); + const BOOL bCancelled = timerQueue->bCancelled; pthread_mutex_unlock(&(timerQueue->cond_mutex)); if ((status != ETIMEDOUT) && (status != 0)) break; - if (timerQueue->bCancelled) + if (bCancelled) break; }