Keep CoreCLR-specific temporary hack under ifdef
authorJan Kotas <jkotas@microsoft.com>
Sun, 27 Jan 2019 19:48:53 +0000 (11:48 -0800)
committerJan Kotas <jkotas@microsoft.com>
Mon, 28 Jan 2019 02:25:07 +0000 (18:25 -0800)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/731b40d96ba0b93057f7334115c3bc00eb434437

src/libraries/System.Private.CoreLib/src/System/Threading/Timer.cs

index fa4f56b..9e1f929 100644 (file)
@@ -472,8 +472,12 @@ namespace System.Threading
                 }
                 else
                 {
-                    // Don't emit this event during EventPipeController.  This avoids initializing FrameworkEventSource during start-up which is expensive relative to the rest of start-up.
-                    if (!EventPipeController.Initializing && FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.ThreadTransfer))
+                    if (
+#if CORECLR
+                        // Don't emit this event during EventPipeController.  This avoids initializing FrameworkEventSource during start-up which is expensive relative to the rest of start-up.
+                        !EventPipeController.Initializing &&
+#endif
+                        FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.ThreadTransfer))
                         FrameworkEventSource.Log.ThreadTransferSendObj(this, 1, string.Empty, true, (int)dueTime, (int)period);
 
                     success = _associatedTimerQueue.UpdateTimer(this, dueTime, period);