Prevents potential deadlock by ensuring any running thread is signaled to terminate before joining, matching the pattern used in other thread classes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Commands used: astyle --style=google --indent=spaces=2 --keep-one-line-blocks src/*.cpp astyle --style=google --indent=spaces=2 --keep-one-line-blocks src/*.h