Add back in code deleted in .NET Core port.
authorVance Morrison <vancemorrison@comcast.net>
Mon, 16 Jul 2018 16:40:31 +0000 (09:40 -0700)
committerVance Morrison <vancemorrison@comcast.net>
Mon, 16 Jul 2018 16:40:31 +0000 (09:40 -0700)
commit8cae2e1f46bbe65961a6d9e0ae8c3a6a1234c6bb
treefaa5c08e14b8f4f2e57727acb635af8d91bb907b
parent28b7fa76f7bd0a29bcc43244c993b339a35ee96f
Add back in code deleted in .NET Core port.

This fixes shutdown race bug that CoreCLR port reintroduced.
Basically the fix needed some Appdomain APIs that were probably
not in .NET Core 1.0 so they were removed.   However they are
back in .NET Core 2.0 so it is trivial to simply 'do the right thing', and
put the shutdown logic back.

See comment in front of DisposeOnShutdown for more.

Commit migrated from https://github.com/dotnet/coreclr/commit/f4b36aa998ead4dddea6c29de6ac0a393fb138a8
src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs