Exemplo n.º 1
0
 internal NeedleLock(LockContext <T> context)
 {
     _context  = context ?? throw new ArgumentNullException(nameof(context));
     _hashCode = base.GetHashCode();
     _capture  = new FlagArray(_context.Capacity);
     _owner    = -1;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 7
0
 internal LockSlot(LockContext <T> context, int id, VersionToken versionToken)
 {
     _context      = context ?? throw new ArgumentNullException(nameof(context));
     _versionToken = versionToken;
     Id            = id;
 }