drop explicit thread state control

using threads->list() should be enough to check for running threads.