The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

a/os: Rename os_thread_helper_stop to os_thread_helper_stop_and_wait

authored by

Ryan Pavlik and committed by
Jakob Bornecrantz
ea4c14c3 14aed901

+19 -14
+3 -3
src/xrt/auxiliary/os/os_threading.h
··· 483 483 * @public @memberof os_thread_helper 484 484 */ 485 485 static inline int 486 - os_thread_helper_stop(struct os_thread_helper *oth) 486 + os_thread_helper_stop_and_wait(struct os_thread_helper *oth) 487 487 { 488 488 void *retval = NULL; 489 489 ··· 515 515 /*! 516 516 * Destroy the thread helper, externally synchronizable. 517 517 * 518 - * Integrates a call to @ref os_thread_helper_stop, so you may just call this for full cleanup 518 + * Integrates a call to @ref os_thread_helper_stop_and_wait, so you may just call this for full cleanup 519 519 * 520 520 * @public @memberof os_thread_helper 521 521 */ ··· 524 524 { 525 525 assert(oth->initialized); 526 526 // Stop the thread. 527 - os_thread_helper_stop(oth); 527 + os_thread_helper_stop_and_wait(oth); 528 528 529 529 // Destroy resources. 530 530 pthread_mutex_destroy(&oth->mutex);
+1 -1
src/xrt/auxiliary/tracking/t_tracker_psmv.cpp
··· 452 452 static void 453 453 break_apart(TrackerPSMV &t) 454 454 { 455 - os_thread_helper_stop(&t.oth); 455 + os_thread_helper_stop_and_wait(&t.oth); 456 456 } 457 457 458 458 } // namespace xrt::auxiliary::tracking::psmv
+1 -1
src/xrt/auxiliary/tracking/t_tracker_psvr.cpp
··· 1948 1948 static void 1949 1949 break_apart(TrackerPSVR &t) 1950 1950 { 1951 - os_thread_helper_stop(&t.oth); 1951 + os_thread_helper_stop_and_wait(&t.oth); 1952 1952 } 1953 1953 1954 1954 } // namespace xrt::auxiliary::tracking::psvr
+1 -1
src/xrt/auxiliary/tracking/t_tracker_slam.cpp
··· 913 913 auto &t = *container_of(node, TrackerSlam, node); 914 914 t.slam->finalize(); 915 915 t.slam->stop(); 916 - os_thread_helper_stop(&t.oth); 916 + os_thread_helper_stop_and_wait(&t.oth); 917 917 SLAM_DEBUG("SLAM tracker dismantled"); 918 918 } 919 919
+1 -1
src/xrt/compositor/main/comp_target_swapchain.c
··· 937 937 938 938 // Thread if it has been started must be stopped first. 939 939 if (cts->vblank.has_started) { 940 - os_thread_helper_stop(&cts->vblank.event_thread); 940 + // Destroy also stops the thread. 941 941 os_thread_helper_destroy(&cts->vblank.event_thread); 942 942 cts->vblank.has_started = false; 943 943 }
+3 -2
src/xrt/compositor/main/comp_window_mswin.c
··· 91 91 comp_window_mswin_destroy(struct comp_target *ct) 92 92 { 93 93 struct comp_window_mswin *cwm = (struct comp_window_mswin *)ct; 94 - // Stop the Windows thread first. 95 - os_thread_helper_stop(&cwm->oth); 94 + 95 + // Stop the Windows thread first, destroy also stops the thread. 96 + os_thread_helper_destroy(&cwm->oth); 96 97 97 98 comp_target_swapchain_cleanup(&cwm->base); 98 99
+1 -1
src/xrt/drivers/euroc/euroc_player.cpp
··· 748 748 struct euroc_player *ep = euroc_player(xfs); 749 749 ep->is_running = false; 750 750 751 - os_thread_helper_stop(&ep->play_thread); 751 + // Destroy also stops the thread. 752 752 os_thread_helper_destroy(&ep->play_thread); 753 753 754 754 return true;
+2 -1
src/xrt/drivers/survive/survive_driver.c
··· 208 208 209 209 if (survive->sys->hmd == NULL && all_null) { 210 210 U_LOG_D("Tearing down libsurvive context"); 211 - os_thread_helper_stop(&survive->sys->event_thread); 211 + 212 + // Destroy also stops the thread. 212 213 os_thread_helper_destroy(&survive->sys->event_thread); 213 214 214 215 // Now that the thread is not running we can destroy the lock.
+3 -1
src/xrt/drivers/ultraleap_v2/ulv2_driver.cpp
··· 369 369 struct ulv2_device *ulv2d = ulv2_device(xdev); 370 370 371 371 ulv2d->pthread_should_stop = true; 372 - os_thread_helper_stop(&ulv2d->leap_loop_oth); 372 + 373 + // Destroy also stops the thread. 374 + os_thread_helper_destroy(&ulv2d->leap_loop_oth); 373 375 374 376 // Remove the variable tracking. 375 377 u_var_remove_root(ulv2d);
+1 -1
src/xrt/drivers/vf/vf_driver.c
··· 401 401 { 402 402 g_main_loop_quit(vid->loop); 403 403 404 - os_thread_helper_stop(&vid->play_thread); 404 + // Destroy also stops the thread. 405 405 os_thread_helper_destroy(&vid->play_thread); 406 406 407 407 free(vid);
+2 -1
src/xrt/targets/cli/cli_cmd_slambatch.c
··· 74 74 timepoint_ns end_time = os_monotonic_get_ns(); 75 75 76 76 pthread_cancel(wfk_thread.thread); 77 - os_thread_helper_stop(&wfk_thread); 77 + 78 + // Destroy also stops the thread. 78 79 os_thread_helper_destroy(&wfk_thread); 79 80 80 81 printf("Done in %.2fs.\n", (double)(end_time - start_time) / U_TIME_1S_IN_NS);