Esempio n. 1
0
        /// <summary>
        /// Dumps information about a possible deadlock to the debugger
        /// output and then breaks into the debugger it one is attached.
        /// </summary>
        /// <param name="target">The lock target.</param>
        /// <param name="info">Information about the thread holding the lock (or <c>null</c>).</param>
        private void DumpAndBreak(object target, LockInfo info)
        {
            if (Debugger.IsAttached)
            {
                if (info != null)
                {
                    Debug.WriteLine("");
                    Debug.WriteLine(info.Dump());
                }

                Debugger.Break();
            }
        }