From 2bcd559aa075186b12a67caa08d589d50e6d6de6 Mon Sep 17 00:00:00 2001 From: iSazonov Date: Thu, 17 May 2018 15:42:47 +0500 Subject: [PATCH 1/2] Clean up #if SILVERLIGHT --- .../engine/interpreter/Utilities.cs | 29 ++----------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/System.Management.Automation/engine/interpreter/Utilities.cs b/src/System.Management.Automation/engine/interpreter/Utilities.cs index de37d530749..7951554ffab 100644 --- a/src/System.Management.Automation/engine/interpreter/Utilities.cs +++ b/src/System.Management.Automation/engine/interpreter/Utilities.cs @@ -754,31 +754,6 @@ public T Update(T newValue) #region Storage implementation -#if SILVERLIGHT - private static int _cfThreadIdDispenser = 1; - - [ThreadStatic] - private static int _cfThreadId; - - private static int GetCurrentThreadId() { - if (PlatformAdaptationLayer.IsCompactFramework) { - // CF doesn't index threads by small integers, so we need to do the indexing ourselves: - int id = _cfThreadId; - if (id == 0) { - _cfThreadId = id = Interlocked.Increment(ref _cfThreadIdDispenser); - } - return id; - } else { - return Thread.CurrentThread.ManagedThreadId; - } - } -#else - private static int GetCurrentThreadId() - { - return Thread.CurrentThread.ManagedThreadId; - } -#endif - /// /// Gets the StorageInfo for the current thread. /// @@ -789,7 +764,7 @@ public StorageInfo GetStorageInfo() private StorageInfo GetStorageInfo(StorageInfo[] curStorage) { - int threadId = GetCurrentThreadId(); + int threadId = Thread.CurrentThread.ManagedThreadId; // fast path if we already have a value in the array if (curStorage != null && curStorage.Length > threadId) @@ -839,7 +814,7 @@ private StorageInfo CreateStorageInfo() StorageInfo[] curStorage = s_updating; try { - int threadId = GetCurrentThreadId(); + int threadId = Thread.CurrentThread.ManagedThreadId; StorageInfo newInfo = new StorageInfo(Thread.CurrentThread); // set to updating while potentially resizing/mutating, then we'll From 50443a1078b70d0e929e330a240d99370a1b3ced Mon Sep 17 00:00:00 2001 From: iSazonov Date: Mon, 21 May 2018 19:26:23 +0500 Subject: [PATCH 2/2] [Feature] Run full test site