Skip to content

Commit

Permalink
Merge pull request #889 from davkean/AvoidReadingResourcesHoldingSema…
Browse files Browse the repository at this point in the history
…phore

Avoid reading resource unless needed
  • Loading branch information
AArnott committed Aug 17, 2021
2 parents af5364d + 8eaab9d commit ed8ffea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Microsoft.VisualStudio.Threading/ReentrantSemaphore.cs
Expand Up @@ -899,7 +899,10 @@ public override RevertRelevance SuppressRelevance()
/// </summary>
protected override void ThrowIfFaulted()
{
Verify.Operation(!this.faulted, Strings.SemaphoreMisused);
if (this.faulted)
{
throw Verify.FailOperation(Strings.SemaphoreMisused);
}
}
}

Expand Down

0 comments on commit ed8ffea

Please sign in to comment.