Use queue features properly and set thread to daemon