Fixed race condition when a thread gets killed right after starting.

2 files changed