private void remove(copyer copyer) { if (copyer.CheckName()) { removeNoCheck(copyer); } }
private void copyStart(copyer copyer) { if (copyer.CheckName()) { bool isGuard; Monitor.Enter(guardLock); try { isGuard = guards.Remove(copyer.ProcessId); } finally { Monitor.Exit(guardLock); } if (isGuard) { saveCache(); } log.Default.Add("启动文件复制 " + copyer.Process, new System.Diagnostics.StackFrame(), false); copyer.Copy(); } }
private void guard(copyer copyer) { if (copyer.CheckName()) { copyer cache; Monitor.Enter(guardLock); try { if (guards.TryGetValue(copyer.ProcessId, out cache)) { guards[copyer.ProcessId] = copyer; } else { guards.Add(copyer.ProcessId, copyer); } } finally { Monitor.Exit(guardLock); } if (cache != null) { pub.Dispose(ref cache); } if (!copyer.Guard(this)) { Monitor.Enter(guardLock); try { if (guards.TryGetValue(copyer.ProcessId, out cache) && cache == copyer) { guards.Remove(copyer.ProcessId); } } finally { Monitor.Exit(guardLock); } } saveCache(); } }
private void remove(copyer copyer) { if (copyer.CheckName()) removeNoCheck(copyer); }
private void guard(copyer copyer) { if (copyer.CheckName()) { copyer cache; Monitor.Enter(guardLock); try { if (guards.TryGetValue(copyer.ProcessId, out cache)) guards[copyer.ProcessId] = copyer; else guards.Add(copyer.ProcessId, copyer); } finally { Monitor.Exit(guardLock); } if (cache != null) pub.Dispose(ref cache); if (!copyer.Guard(this)) { Monitor.Enter(guardLock); try { if (guards.TryGetValue(copyer.ProcessId, out cache) && cache == copyer) guards.Remove(copyer.ProcessId); } finally { Monitor.Exit(guardLock); } } saveCache(); } }
private void copyStart(copyer copyer) { if (copyer.CheckName()) { bool isGuard; Monitor.Enter(guardLock); try { isGuard = guards.Remove(copyer.ProcessId); } finally { Monitor.Exit(guardLock); } if (isGuard) saveCache(); log.Default.Add("启动文件复制 " + copyer.Process, false, false); copyer.Copy(); } }