Assign globally unique tids in makeAllThreads
Put tid++ in the loop body