Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Add()

bool System.Transactions.Bucket.Add ( InternalTransaction tx)
inlinepackage

Definition at line 30 of file Bucket.cs.

31 {
32 int num = Interlocked.Increment(ref _index);
33 if (num < _size)
34 {
35 tx._tableBucket = this;
36 tx._bucketIndex = num;
38 _transactions[num] = tx;
39 if (_timedOut)
40 {
41 lock (tx)
42 {
43 tx.State.Timeout(tx);
44 }
45 }
46 return true;
47 }
48 Bucket bucket = new Bucket(_owningSet);
49 bucket.nextBucketWeak = new WeakReference(this);
50 Bucket bucket2 = Interlocked.CompareExchange(ref _owningSet.headBucket, bucket, this);
51 if (bucket2 == this)
52 {
53 _previous = bucket;
54 }
55 return false;
56 }
static int CompareExchange(ref int location1, int value, int comparand)
static int Increment(ref int location)
readonly BucketSet _owningSet
Definition Bucket.cs:19
Bucket(BucketSet owningSet)
Definition Bucket.cs:21
readonly InternalTransaction[] _transactions
Definition Bucket.cs:13
virtual void Timeout(InternalTransaction tx)

References System.Transactions.Bucket.Bucket(), System.Transactions.Bucket._index, System.Transactions.Bucket._owningSet, System.Transactions.Bucket._previous, System.Transactions.Bucket._size, System.Transactions.Bucket._timedOut, System.Transactions.Bucket._transactions, System.Threading.Interlocked.CompareExchange(), System.Transactions.BucketSet.headBucket, System.Threading.Interlocked.Increment(), System.Threading.Interlocked.MemoryBarrier(), System.Transactions.InternalTransaction.State, and System.Transactions.TransactionState.Timeout().

Referenced by System.Transactions.BucketSet.Add().