The race condition was created in a7c8964e in 17.11.6 when removing the (unsafe) pthread_cancel code handling thread termination. Bug 5164