Simplified termination logic for two worker threads