Revert "Correct the logic to timeout a worker thread."

This reverts commit 8b6b9379049b95d5d56399f8547952b4d3e77e2c.