Here is a meaningless extension method as an example:
public static class MyExtensions
{
public static int MyExtensionMethod(this MyType e)
{
int x = 1;
x = 2;
return x
}
}
Say a thread of execution completes upto and including the line:
x = 2;
The processor then context switches and another thread enters the same method and completes the line:
int x = 1;
Am I correct in assuming that the variable "x" created and assigned by the first thread is on a separate stack to the variable "x" created and assigned by the second, meaning this method is re-entrant?