Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Commit

Permalink
Shorter ExecutionContext.Capture (dotnet/coreclr#21707)
Browse files Browse the repository at this point in the history
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
  • Loading branch information
benaadams authored and jkotas committed Dec 30, 2018
1 parent dfb9267 commit 289f0dc
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,16 @@ public void GetObjectData(SerializationInfo info, StreamingContext context)
public static ExecutionContext Capture()
{
ExecutionContext executionContext = Thread.CurrentThread.ExecutionContext;
return
executionContext == null ? Default :
executionContext.m_isFlowSuppressed ? null :
executionContext;
if (executionContext == null)
{
executionContext = Default;
}
else if (executionContext.m_isFlowSuppressed)
{
executionContext = null;
}

return executionContext;
}

private ExecutionContext ShallowClone(bool isFlowSuppressed)
Expand Down

0 comments on commit 289f0dc

Please sign in to comment.