public void ClaimInstantiationState() { //! Spin until the lock can be claimed. while (Interlocked.CompareExchange(ref isProfilingInstantiations, 1, 0) == 1) ; }