The open source OpenXR runtime

c/multi: Return from multi-compositor wait functions if the session has stopped.

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2491>

authored by

Connor Smith and committed by
Marge Bot
e135cd3d e945b751

+7 -6
+7 -6
src/xrt/compositor/multi/comp_multi_compositor.c
··· 1 1 // Copyright 2019-2021, Collabora, Ltd. 2 + // Copyright 2024-2025, NVIDIA CORPORATION. 2 3 // SPDX-License-Identifier: BSL-1.0 3 4 /*! 4 5 * @file ··· 123 124 } 124 125 125 126 static void 126 - wait_fence(struct xrt_compositor_fence **xcf_ptr) 127 + wait_fence(struct multi_compositor *mc, struct xrt_compositor_fence **xcf_ptr) 127 128 { 128 129 COMP_TRACE_MARKER(); 129 130 xrt_result_t ret = XRT_SUCCESS; ··· 138 139 } 139 140 140 141 U_LOG_W("Waiting on client fence timed out > 100ms!"); 141 - } while (true); 142 + } while (os_thread_helper_is_running(&mc->wait_thread.oth)); 142 143 143 144 xrt_compositor_fence_destroy(xcf_ptr); 144 145 ··· 148 149 } 149 150 150 151 static void 151 - wait_semaphore(struct xrt_compositor_semaphore **xcsem_ptr, uint64_t value) 152 + wait_semaphore(struct multi_compositor *mc, struct xrt_compositor_semaphore **xcsem_ptr, uint64_t value) 152 153 { 153 154 COMP_TRACE_MARKER(); 154 155 xrt_result_t ret = XRT_SUCCESS; ··· 163 164 } 164 165 165 166 U_LOG_W("Waiting on client semaphore value '%" PRIu64 "' timed out > 100ms!", value); 166 - } while (true); 167 + } while (os_thread_helper_is_running(&mc->wait_thread.oth)); 167 168 168 169 xrt_compositor_semaphore_reference(xcsem_ptr, NULL); 169 170 ··· 288 289 os_thread_helper_unlock(&mc->wait_thread.oth); 289 290 290 291 if (xcsem != NULL) { 291 - wait_semaphore(&xcsem, value); 292 + wait_semaphore(mc, &xcsem, value); 292 293 } 293 294 if (xcf != NULL) { 294 - wait_fence(&xcf); 295 + wait_fence(mc, &xcf); 295 296 } 296 297 297 298 // Sample time outside of lock.