示例#1
0
        public LockFileBasedSemaphore(string name, TimeSpan lockTimeout, ILockIo lockIo, IProcessFinder processFinder, ILog log)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException(nameof(name), "name cannot be null or emtpy.");
            }

            Name               = name;
            LockTimeout        = lockTimeout;
            LockFilePath       = lockIo.GetFilePath(name);
            this.lockIo        = lockIo;
            this.processFinder = processFinder;
            this.log           = log;
        }
示例#2
0
 internal LockFileBasedSemaphore(string name, TimeSpan lockTimeout, ILockIo lockIo, IProcessFinder processFinder)
     : this(name, lockTimeout, lockIo, processFinder, new LogWrapper())
 {
 }