private static void PrefixStreamEventNode(StreamEventNode head) { head.ThreadId = Thread.CurrentThread.ManagedThreadId; while (true) { StreamEventNode n = root; head.Next = n; if (Interlocked.CompareExchange(ref root, head, n) == n) { return; } } }
public static string ConsumeTraceDescription() { StringBuilder result = new StringBuilder(); StreamEventNode n = root; root = null; while (n != null) { result.AppendLine( "object #" + n.InstanceId + " was " + (n.IsCreation ? "created " : "disposed") + " on thread #" + n.ThreadId + " at:\r\n" + n.StackTraceText); n = n.Next; } return(result.ToString()); }
public static string ConsumeTraceDescription() { StringBuilder result = new StringBuilder(); StreamEventNode n = root; root = null; while (n != null) { result.AppendLine( "object #" + n.InstanceId + " was " + (n.IsCreation ? "created " : "disposed") + " on thread #" + n.ThreadId + " at:\r\n" + n.StackTraceText); n = n.Next; } return result.ToString(); }