tsan: fix a potential hang

idx0 is not updated in the branch,
so if we take that branch idx0 will stay updated forever