Here is a meaningless extension method as an example:
public static class MyExtensions
{
public static int MyExtensionMethod(this MyType e)
{
in
Yes, that's a correct assessment. x
is a method-local variable, and won't be shared between invocations of MyExtensionMethod
.
Quite simply, yes. A static method only means that the method can be called without an object. The local variables within the method are still local.
Yes, each thread gets its own separate local variable. This function will always return 2 even if called by multiple threads simultaneously.