Stopping long-sleep threads
Use a condition variable. You wait on the condition variable or 5 minutes passing. Remember to check for spurious wakeups. cppreference I cannot find a good stack overflow post on how to use a condition variable in a minute or two of google searching. The tricky part is realizing that the wait can wake up … Read more