Example #1
0
        private void Capture(LockableSlot slot)
        {
            var lockslot = slot.LockSlot;

            if (ReferenceEquals(lockslot, null))
            {
                throw new InvalidOperationException("The current thread has not entered the LockableContext of this LockableNeedle.");
            }
            _needleLock.Capture(lockslot);
            slot.Add(_needleLock);
        }
Example #2
0
            bool IResource.Capture()
            {
                var transaction = CurrentTransaction;

                if (transaction == null)
                {
                    return(false);
                }
                var lockSlot = transaction._lockSlot;

                if (lockSlot == null)
                {
                    return(false);
                }
                _needleLock.Capture(lockSlot);
                return(true);
            }