提交 cf454bdb 编写于 作者: D David Poeschl

Avoid deadlock on solution close with linked files

Fixes #17305
Fixes
https://devdiv.visualstudio.com/0bdbc590-a062-4c3f-b0f6-9383f67865ee/_workitems?id=388328&_a=edit
上级 6dd171a7
......@@ -335,14 +335,7 @@ protected void OnDocumentContextUpdated(DocumentId documentId)
if (container != null)
{
if (_isProjectUnloading.Value)
{
OnDocumentContextUpdated_NoSerializationLock(documentId, container);
}
else
{
OnDocumentContextUpdated(documentId, container);
}
OnDocumentContextUpdated(documentId, container);
}
}
......@@ -351,10 +344,19 @@ protected void OnDocumentContextUpdated(DocumentId documentId)
/// </summary>
internal void OnDocumentContextUpdated(DocumentId documentId, SourceTextContainer container)
{
using (_serializationLock.DisposableWait())
if (_isProjectUnloading.Value)
{
// When the project is unloading, the serialization lock is already taken, so there
// is no need for us to take the lock since everything is already serialized.
OnDocumentContextUpdated_NoSerializationLock(documentId, container);
}
else
{
using (_serializationLock.DisposableWait())
{
OnDocumentContextUpdated_NoSerializationLock(documentId, container);
}
}
}
internal void OnDocumentContextUpdated_NoSerializationLock(DocumentId documentId, SourceTextContainer container)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册