internal static IServerConfig GetDefaultDomainInstance(string version) { if (version == null) { return GetInstance(); } ExpressServerConfig config = null; lock (s_expressConfigsLock) { if (s_expressConfigs == null) { if (!Thread.GetDomain().IsDefaultAppDomain()) { throw new InvalidOperationException(); } s_expressConfigs = new Dictionary<string, ExpressServerConfig>(3); } if (!s_expressConfigs.TryGetValue(version, out config)) { config = new ExpressServerConfig(version); s_expressConfigs[version] = config; } } return config; }
// called by HostingEnvironment to initiliaze the singleton config // instance for the domain static internal IServerConfig GetInstance(string version) { if (s_instance == null) { lock (s_initLock) { if (s_instance == null) { if (Thread.GetDomain().IsDefaultAppDomain()) { throw new InvalidOperationException(); } s_instance = new ExpressServerConfig(version); } } } return s_instance; }