From 2300e4fa574512b26af5893770009e3b07521e41 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 26 May 2022 20:48:15 +0100 Subject: [PATCH] c/main: Document cond var loop --- src/xrt/compositor/main/comp_target_swapchain.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xrt/compositor/main/comp_target_swapchain.c b/src/xrt/compositor/main/comp_target_swapchain.c index 3790205e8..e5d22bcfc 100644 --- a/src/xrt/compositor/main/comp_target_swapchain.c +++ b/src/xrt/compositor/main/comp_target_swapchain.c @@ -540,7 +540,11 @@ run_vblank_event_thread(void *ptr) // Wait to be woken up. os_thread_helper_wait_locked(&cts->vblank.event_thread); - // Check if we should stop. + /* + * Loop back to the top to check if we should stop, + * also handles spurious wakeups by re-checking the + * condition in the if case. Essentially two loops. + */ continue; }