How to Tie the Thread Loop