Example #1
0
 internal NeedleLock(LockContext <T> context)
 {
     _context  = context ?? throw new ArgumentNullException(nameof(context));
     _hashCode = base.GetHashCode();
     _capture  = new FlagArray(_context.Capacity);
     _owner    = -1;
 }
Example #2
0
 internal LockSlot(LockContext <T> context, int id, VersionProvider.VersionToken versionToken)
 {
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     _context      = context;
     _versionToken = versionToken;
     _id           = id;
 }
Example #3
0
 internal LockSlot(LockContext <T> context, int id, VersionProvider.VersionToken versionToken)
 {
     if (ReferenceEquals(context, null))
     {
         throw new ArgumentNullException("context");
     }
     _context      = context;
     _versionToken = versionToken;
     Id            = id;
 }
Example #4
0
 internal NeedleLock(LockContext <T> context)
 {
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     _context  = context;
     _hashCode = base.GetHashCode();
     _capture  = new FlagArray(_context.Capacity);
     _owner    = -1;
 }
Example #5
0
 internal NeedleLock(LockContext <T> context, T target)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
     if (target == null)
     {
         _hashCode = base.GetHashCode();
     }
     else
     {
         _target   = target;
         _hashCode = target.GetHashCode();
     }
     _capture = new FlagArray(_context.Capacity);
     _owner   = -1;
 }
Example #6
0
 internal NeedleLock(LockContext <T> context, T target)
 {
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     _context = context;
     if (ReferenceEquals(target, null))
     {
         _hashCode = base.GetHashCode();
     }
     else
     {
         _target   = target;
         _hashCode = target.GetHashCode();
     }
     _capture = new FlagArray(_context.Capacity);
     _owner   = -1;
 }
Example #7
0
 internal LockSlot(LockContext <T> context, int id, VersionToken versionToken)
 {
     _context      = context ?? throw new ArgumentNullException(nameof(context));
     _versionToken = versionToken;
     Id            = id;
 }