Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing windows static thread pool destructor deadlock.
On a windows build, the thread pool destructor will deadlock after a period of idle time. This is happening because m_count has become sufficiently large that the YieldProcessor loop will block for minutes at a time. Flipping the next_spin_will_yield check fixes this behavior, and I imagine was the intended behavior in the first place. This results in the lighter YieldProcessor calls being hit first, followed by the heavier OS Sleep calls, which continue until the spin resets or m_count wraps.
- Loading branch information
242db2b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding this! Did you want to submit a PR?
If not, I can apply the fix manually.