Address PR feedback and other cleanup
authorStephen Toub <stoub@microsoft.com>
Sun, 5 Feb 2017 14:27:53 +0000 (09:27 -0500)
committerStephen Toub <stoub@microsoft.com>
Sun, 5 Feb 2017 14:47:44 +0000 (09:47 -0500)
commitb72fc3aa651ffdeb9136f785fc7631663a92685f
treebaab97e6704eec73eb9691ec7d6d838366090272
parentf338eaae1d696e414632ba8f630457f7a0d562ab
Address PR feedback and other cleanup

Addressed PR comment about removing ExecutionContext.Capture(ref StackCrawlMark, ...), which led me to remove NoInlining/StackCrawlMarks from some other places in Timer, Thread, ThreadPool, and Overlapped.

In doing so, I found several other unnecessary members on ExecutionContext that could be removed with minor tweaks elsewhere in the source, e.g.
- Dispose is a nop, so we can remove explicit try/finally's to clean it up
- ExecutionContext.Run(..., bool) just ignores the bool arg, so it can be removed and all call sites redirected (but I've left it in EC, as it appears it's used via internals visible from a library in corefx)
- FastCapture() just calls Capture, so the call sites can be changed (but I've left it in EC for a similar reason)
- PreAllocatedDefault can be removed in favor of Default; etc.
- ExecutionContext.Capture itself checks whether flow is suppressed; doing a check before it adds a TLS lookup and in doing so optimizes for an uncommon case in exchange for making the common case more expensive.  I've removed those checks.

And in the process, I also noticed that several lazily initialized delegates that no longer need to be, and cleaned those up.  These were lazy due to needing to be for security checks that aren't relevant in coreclr.
src/mscorlib/src/System/IO/Stream.cs
src/mscorlib/src/System/Runtime/CompilerServices/AsyncMethodBuilder.cs
src/mscorlib/src/System/Threading/ExecutionContext.cs
src/mscorlib/src/System/Threading/Overlapped.cs
src/mscorlib/src/System/Threading/Tasks/Task.cs
src/mscorlib/src/System/Threading/Tasks/TaskContinuation.cs
src/mscorlib/src/System/Threading/Thread.cs
src/mscorlib/src/System/Threading/ThreadPool.cs
src/mscorlib/src/System/Threading/Timer.cs