示例#1
0
        public void BlockingStart(DectectionSource dectectionSource)
        {
            if (!Thread.CurrentThread.IsThreadPoolThread)
            {
                return;
            }

            t_recursionCount++;

            try
            {
                if (t_recursionCount == 1)
                {
                    var framesToSkip = dectectionSource == DectectionSource.SynchronizationContext ? 3 : 6;

                    if (BlockingMonitor.LogBlockingMethodCalls)
                    {
                        _logger.BlockingMethodCalled(new StackTrace(framesToSkip, true));
                    }

                    // We omit the frame creation here becuase including a skip and file details doesn't return
                    // file numbers in .NET core 3.1
                    BlockingMonitor.BlockingMethodCalled?.Invoke(new StackTrace(true), framesToSkip);
                }
            }
            catch
            {
            }
        }
        public void BlockingStart(DectectionSource dectectionSource)
        {
            if (!Thread.CurrentThread.IsThreadPoolThread)
            {
                return;
            }

            t_recursionCount++;

            try
            {
                if (t_recursionCount == 1)
                {
                    _logger.BlockingMethodCalled(
                        new StackTrace(dectectionSource == DectectionSource.SynchronizationContext ? 3 : 6));
                }
            }
            catch
            {
            }
        }