Esempio n. 1
0
        /// <inheritdoc cref="Manager.Attach"/>
        public override void Attach()
        {
            base.Attach();
            if (!_patched)
            {
                _patched      = true;
                _patchContext = _patchMgr.AcquireContext();
                ProfilerPatch.Patch(_patchContext);

                _canceller?.Cancel();
                _canceller?.Dispose();
                _canceller = new CancellationTokenSource();

                ThreadPool.QueueUserWorkItem(_ =>
                {
                    try
                    {
                        ProfilerResultQueue.Start(_canceller.Token);
                    }
                    catch (Exception e)
                    {
                        Log.Error(e);
                    }
                });
            }
        }
Esempio n. 2
0
 /// <inheritdoc cref="Manager.Attach"/>
 public override void Attach()
 {
     base.Attach();
     if (!_patched)
     {
         _patched      = true;
         _patchContext = _patchMgr.AcquireContext();
         ProfilerPatch.Patch(_patchContext);
     }
 }