提交 f0713cfd 编写于 作者: H Heejae Chang

Merge pull request #5380 from heejaechang/logging

added logging info to GlobalOperationRegistration
......@@ -310,5 +310,6 @@ internal enum FunctionId
VisualBasic_Interactive_Window,
NonFatalWatson,
GlobalOperationRegistration,
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Threading;
using Microsoft.CodeAnalysis.Internal.Log;
namespace Microsoft.CodeAnalysis.Notification
{
internal class GlobalOperationRegistration : IDisposable
{
private readonly AbstractGlobalOperationNotificationService _service;
private readonly CancellationTokenSource _source;
private readonly IDisposable _logging;
private bool _done;
public GlobalOperationRegistration(AbstractGlobalOperationNotificationService service, string operation)
{
_service = service;
this.Operation = operation;
_done = false;
this.Operation = operation;
_source = new CancellationTokenSource();
_logging = Logger.LogBlock(FunctionId.GlobalOperationRegistration, operation, _source.Token);
}
public string Operation { get; }
......@@ -28,10 +36,15 @@ public void Dispose()
if (_done)
{
_service.Done(this);
_logging.Dispose();
}
else
{
_service.Cancel(this);
_source.Cancel();
_logging.Dispose();
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册