Skip to content

Commit

Permalink
wasapi: Remove thread shutdown timeout.
Browse files Browse the repository at this point in the history
This was a workaround for rare pre-Windows 10 systems where the render
thread would hang inside OS API calls for multiple seconds.
  • Loading branch information
kinetiknz committed Jan 27, 2025
1 parent 048f4a0 commit 2816b5a
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/cubeb_wasapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1780,16 +1780,7 @@ stop_and_join_render_thread(cubeb_stream * stm)
return false;
}

/* Wait five seconds for the rendering thread to return. It's supposed to
* check its event loop very often, five seconds is rather conservative.
* Note: 5*1s loop to work around timer sleep issues on pre-Windows 8. */
DWORD r;
for (int i = 0; i < 5; ++i) {
r = WaitForSingleObject(stm->thread, 1000);
if (r == WAIT_OBJECT_0) {
break;
}
}
DWORD r = WaitForSingleObject(stm->thread, INFINITE);
if (r != WAIT_OBJECT_0) {
LOG("stop_and_join_render_thread: WaitForSingleObject on thread failed: "
"%lx, %lx",
Expand Down

0 comments on commit 2816b5a

Please sign in to comment.