TestDestroy() doesn't work for joinable threads, so use a shared variable.