"Atomic Read/Write Using Locking"

private static readonly object staticMutationLock = new object();
private static decimal sharedState;
public static decimal SharedState {
	get {
		lock (staticMutationLock) {
			return sharedState;
		}
	}
	set {
		lock (staticMutationLock) {
			sharedState = value;
		}
	}
}


Code snippet taken from "Common Multithreading Mistakes in C# - III: Unsafe Assumptions".