And change variable number . Bot take last number, increase number and put in list. But when you have muliti thread a lot threads take same number and put same number in list.
You should use C# code and lock List if you want to combine take line + increase value + add to list and if you want for ther threads to wait until this group of actions will be executed.