public TransactNeedle(T value, ICloner <T> cloner, IEqualityComparer <T> comparer) : base(value) { _cloner = cloner ?? throw new ArgumentNullException(nameof(cloner)); _comparer = comparer ?? EqualityComparer <T> .Default; _needleLock = new NeedleLock <Thread>(Transact.Context); _id = RuntimeUniqueIdProvider.GetNextId(); }
public TransactNeedle(T value, IEqualityComparer <T> comparer) : base(value) { _cloner = CloneHelper <T> .GetCloner(); if (_cloner == null) { throw new InvalidOperationException("Unable to get a cloner for " + typeof(T)); } _comparer = comparer ?? EqualityComparer <T> .Default; _needleLock = new NeedleLock <Thread>(Transact.Context); _id = RuntimeUniqueIdProvider.GetNextId(); }
public Pool(int capacity, Action <T> recycler) { _reentryGuardId = RuntimeUniqueIdProvider.GetNextId(); _entries = new FixedSizeQueue <T>(capacity); _recycler = recycler; }
public Pool(int capacity, Action <T> recycler) { _id = RuntimeUniqueIdProvider.GetNextId(); _entries = new FixedSizeQueue <T>(capacity); _recycler = recycler ?? throw new ArgumentNullException(nameof(recycler)); }