If one creates a readonly static member like this:
public sealed class MyClass
{
public readonly static MyClass Instance = new MyClass();
}
.NET CLR ensures that static initialization is always thread-safe. No matter how many threads are accessing it and what order, it will always be initialized once.
Your code seems to show signs of the beginnings of a Singleton pattern.
Basically if you want to run custom code before you initialize the class, then you need to ensure thread-safety on your own.
This is an example where you would need to make your custom code thread safe. But the static initialization part is always thread safe.
The class initialization is guaranteed by the specification of the C# language to be thread safe, so only one instance of MyClass
will be created. You would have to ensure thread safety from that point onwards yourself. Here's an MSDN reference:
http://msdn.microsoft.com/en-us/library/aa645612.aspx