Please consider the following class/method being called from a Blazor page instance class. My question is: if two threads call the MyStaticMethod concurrently passing the same ref int index reference as argument, is it possible that the index will not be incremented twice?
public static class MyStaticClass
{
public static MyClass1 MyStaticMethod(ref int index, string paramValue1,
MyClass2[]? paramValues2, int paramValue3)
{
MyClass1 result = new { Prop1 = paramValue1,
Prop2 = paramValues2.SomeIntegerValue, Prop3 = paramValue3 };
index++;
return result;
}
}