Browse Source

Switched away form ConditionalWeakTable to support Net3

4.0.0-beta
Anairkoen Schno 5 years ago
parent
commit
c3dff05236
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      IPA.Loader/Config/ConfigRuntime.cs

+ 3
- 3
IPA.Loader/Config/ConfigRuntime.cs View File

@ -28,8 +28,8 @@ namespace IPA.Config
private static readonly AutoResetEvent configsChangedWatcher = new AutoResetEvent(false); private static readonly AutoResetEvent configsChangedWatcher = new AutoResetEvent(false);
private static readonly ConcurrentDictionary<DirectoryInfo, FileSystemWatcher> watchers private static readonly ConcurrentDictionary<DirectoryInfo, FileSystemWatcher> watchers
= new ConcurrentDictionary<DirectoryInfo, FileSystemWatcher>(new DirInfoEqComparer()); = new ConcurrentDictionary<DirectoryInfo, FileSystemWatcher>(new DirInfoEqComparer());
private static readonly ConditionalWeakTable<FileSystemWatcher, ConcurrentBag<Config>> watcherTrackConfigs
= new ConditionalWeakTable<FileSystemWatcher, ConcurrentBag<Config>>();
private static readonly ConcurrentDictionary<FileSystemWatcher, ConcurrentBag<Config>> watcherTrackConfigs
= new ConcurrentDictionary<FileSystemWatcher, ConcurrentBag<Config>>();
private static SingleThreadTaskScheduler loadScheduler = null; private static SingleThreadTaskScheduler loadScheduler = null;
private static TaskFactory loadFactory = null; private static TaskFactory loadFactory = null;
private static Thread saveThread = null; private static Thread saveThread = null;
@ -99,7 +99,7 @@ namespace IPA.Config
watcher.EnableRaisingEvents = false; // disable while we do shit watcher.EnableRaisingEvents = false; // disable while we do shit
var bag = watcherTrackConfigs.GetOrCreateValue(watcher);
var bag = watcherTrackConfigs.GetOrAdd(watcher, w => new ConcurrentBag<Config>());
// we don't need to check containment because this function will only be called once per config ever // we don't need to check containment because this function will only be called once per config ever
bag.Add(config); bag.Add(config);


Loading…
Cancel
Save