summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mscorlib/src/System/AppDomain.cs47
-rw-r--r--src/mscorlib/src/System/AppDomainSetup.cs12
2 files changed, 6 insertions, 53 deletions
diff --git a/src/mscorlib/src/System/AppDomain.cs b/src/mscorlib/src/System/AppDomain.cs
index edd53b22da..76e7f8f845 100644
--- a/src/mscorlib/src/System/AppDomain.cs
+++ b/src/mscorlib/src/System/AppDomain.cs
@@ -566,17 +566,6 @@ namespace System
throw new ArgumentNullException(nameof(name));
Contract.EndContractBlock();
- // SetData should only be used to set values that don't already exist.
- object currentVal;
- lock (((ICollection)LocalStore).SyncRoot)
- {
- LocalStore.TryGetValue(name, out currentVal);
- }
- if (currentVal != null)
- {
- throw new InvalidOperationException(SR.InvalidOperation_SetData_OnlyOnce);
- }
-
lock (((ICollection)LocalStore).SyncRoot)
{
LocalStore[name] = data;
@@ -590,38 +579,14 @@ namespace System
throw new ArgumentNullException(nameof(name));
Contract.EndContractBlock();
- int key = AppDomainSetup.Locate(name);
- if (key == -1)
- {
- if (name.Equals(AppDomainSetup.LoaderOptimizationKey))
- return FusionStore.LoaderOptimization;
- else
- {
- object data;
- lock (((ICollection)LocalStore).SyncRoot)
- {
- LocalStore.TryGetValue(name, out data);
- }
- if (data == null)
- return null;
- return data;
- }
- }
- else
+ object data;
+ lock (((ICollection)LocalStore).SyncRoot)
{
- // Be sure to call these properties, not Value, so
- // that the appropriate permission demand will be done
- switch (key)
- {
- case (int)AppDomainSetup.LoaderInformation.ApplicationBaseValue:
- return FusionStore.ApplicationBase;
- case (int)AppDomainSetup.LoaderInformation.ApplicationNameValue:
- return FusionStore.ApplicationName;
- default:
- Debug.Assert(false, "Need to handle new LoaderInformation value in AppDomain.GetData()");
- return null;
- }
+ LocalStore.TryGetValue(name, out data);
}
+ if (data == null)
+ return null;
+ return data;
}
[Obsolete("AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread. http://go.microsoft.com/fwlink/?linkid=14202", false)]
diff --git a/src/mscorlib/src/System/AppDomainSetup.cs b/src/mscorlib/src/System/AppDomainSetup.cs
index 142b8a05f7..589ed1812a 100644
--- a/src/mscorlib/src/System/AppDomainSetup.cs
+++ b/src/mscorlib/src/System/AppDomainSetup.cs
@@ -338,18 +338,6 @@ namespace System
}
}
- static internal int Locate(String s)
- {
- if (String.IsNullOrEmpty(s))
- return -1;
-
- Debug.Assert('A' == ACTAG_APP_BASE_URL[0], "Assumption violated");
- if (s[0] == 'A' && s == ACTAG_APP_BASE_URL)
- return (int)LoaderInformation.ApplicationBaseValue;
-
- return -1;
- }
-
#if FEATURE_COMINTEROP
public bool SandboxInterop
{