提交 021d6666 编写于 作者: V VSadov

Upon completion give waiters up to 10 sec. to report diagnostics before canceling

上级 faf8e7a5
......@@ -177,6 +177,21 @@ private bool CompleteCore()
{
if (existingWaiters != null)
{
// we have waiters and we have data.
// allow some extra time to drain the queue before cancelling
// but do not wait for too long.
SpinWait.SpinUntil(() =>
{
lock (SyncObject)
{
return _data.Count == 0;
}
},
10000);
// cancel waiters.
// NOTE: this could result in losing diagnostics
// see https://github.com/dotnet/roslyn/issues/11470
foreach (var tcs in existingWaiters)
{
tcs.SetCanceled();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册