public static void Begin() { if (_pad == null) _pad = new ScratchPadContainer(); else _pad.AddRef(); }
public static void Begin() { var pad = (ScratchPadContainer)Thread.GetData(scratchPadTlsSlot); if (pad == null) { pad = new ScratchPadContainer(); Thread.SetData(scratchPadTlsSlot, pad); } else { pad.AddRef(); } }
public static void End() { if (_pad == null || !_pad.Release()) return; _pad = null; }