예제 #1
0
        public MemoryLock(MemoryLockManager lockManager, string resourceType, IEnumerable <string> resources, TimeSpan expiryTime)
        {
            LockManager  = lockManager;
            ResourceType = resourceType;
            ExpiryTime   = expiryTime;
            Status       = MemoryLockStatus.Waiting;

            ResourceKeys = resources.Select(r => _prefix + resourceType + r).ToList();

            ResourceValues = new List <string>(ResourceKeys.Count);

            for (int i = 0; i < ResourceKeys.Count; ++i)
            {
                ResourceValues.Add(SecurityUtil.CreateUniqueToken());
            }
        }
예제 #2
0
        //public void Dispose()
        //{
        //    LockManager.Unlock(this);
        //}

        public void StopKeepAliveTimer()
        {
            MemoryLockManager.StopKeepAliveTimer(this);
        }