public void Dispose() { if (p_ != null) { Debug.Assert(next_ == null); p_.Exit(); p_ = null; next_ = foos_; foos_ = this; } }
public static XProfile Get(string name) { XProfile ret; if (profiles_.TryGetValue(name, out ret)) { return(ret); } ret = new XProfile(name); profiles_.Add(name, ret); return(ret); }
internal static Foo NewFoo(XProfile p) { if (foos_ == null) { return(new Foo(p)); } Foo ret = foos_; foos_ = ret.next_; ret.next_ = null; ret.p_ = p; p.Enter(); return(ret); }
Foo(XProfile p) { p_ = p; p.Enter(); }