public void WithLock(WithLockCallback action) { Mutex mutex = new Mutex(false, this.lockFile.Replace("\\", "")); try { mutex.WaitOne(); action(); } catch { } finally { mutex.ReleaseMutex(); } }
public void WithLock(WithLockCallback action) { Mutex mutex = new Mutex(false, this.lockFile.Replace("\\", "")); try { mutex.WaitOne(); action(); } catch { } finally { mutex.ReleaseMutex(); } }