Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
InternalTransaction.cs
Go to the documentation of this file.
5
6namespace System.Transactions;
7
8internal sealed class InternalTransaction : IDisposable
9{
11
13
15
16 internal byte[] promotedToken;
17
19
21
22 internal readonly int _transactionHash;
23
24 internal static int _nextHash;
25
26 private readonly long _absoluteTimeout;
27
28 private long _creationTime;
29
31
33
35
37
39
41
43
45
47
48 internal int _bucketIndex;
49
50 internal TransactionCompletedEventHandler _transactionCompletedDelegate;
51
53
55
56 internal int _cloneCount;
57
58 internal int _enlistmentCount;
59
61
62 internal bool _asyncCommit;
63
64 internal AsyncCallback _asyncCallback;
65
66 internal object _asyncState;
67
68 internal bool _needPulse;
69
71
73
74 internal readonly Transaction _outcomeSource;
75
76 private static object s_classSyncObject;
77
78 private static string s_instanceIdentifier;
79
80 private volatile bool _traceIdentifierInited;
81
83
85
87
88 internal TransactionState State
89 {
90 get
91 {
92 return _transactionState;
93 }
94 set
95 {
97 }
98 }
99
101
103
104 internal long CreationTime
105 {
106 get
107 {
108 return _creationTime;
109 }
110 set
111 {
113 }
114 }
115
117 {
118 get
119 {
121 }
122 set
123 {
125 }
126 }
127
128 internal Guid DistributedTxId => State.get_Identifier(this);
129
130 internal static string InstanceIdentifier => LazyInitializer.EnsureInitialized(ref s_instanceIdentifier, ref s_classSyncObject, () => $"{Guid.NewGuid()}:");
131
133 {
134 get
135 {
137 {
138 lock (this)
139 {
141 {
143 DefaultInterpolatedStringHandler handler = new DefaultInterpolatedStringHandler(0, 2, invariantCulture);
146 TransactionTraceIdentifier traceIdentifier = new TransactionTraceIdentifier(string.Create(invariantCulture, ref handler), 0);
147 _traceIdentifier = traceIdentifier;
149 }
150 }
151 }
152 return _traceIdentifier;
153 }
154 }
155
164
172
182
192
202
203 internal void SignalAsyncCompletion()
204 {
205 if (_asyncResultEvent != null)
206 {
208 }
209 if (_asyncCallback != null)
210 {
211 Monitor.Exit(this);
212 try
213 {
215 }
216 finally
217 {
218 Monitor.Enter(this);
219 }
220 }
221 }
222
223 internal void FireCompletion()
224 {
225 TransactionCompletedEventHandler transactionCompletedDelegate = _transactionCompletedDelegate;
226 if (transactionCompletedDelegate != null)
227 {
228 TransactionEventArgs transactionEventArgs = new TransactionEventArgs();
229 transactionEventArgs._transaction = _outcomeSource.InternalClone();
230 transactionCompletedDelegate(transactionEventArgs._transaction, transactionEventArgs);
231 }
232 }
233
234 public void Dispose()
235 {
236 if (_promotedTransaction != null)
237 {
239 }
240 }
241}
static CultureInfo InvariantCulture
static string PromoterTypeUnrecognized
Definition SR.cs:84
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string PromoterTypeInvalid
Definition SR.cs:82
Definition SR.cs:7
static void Exit(object obj)
static void Enter(object obj)
TransactionTraceIdentifier _traceIdentifier
TransactionCompletedEventHandler _transactionCompletedDelegate
InternalTransaction(Transaction outcomeSource, DistributedTransaction distributedTx)
TransactionTraceIdentifier TransactionTraceId
readonly CommittableTransaction _committableTransaction
InternalTransaction(TimeSpan timeout, CommittableTransaction committableTransaction)
InternalTransaction(Transaction outcomeSource, ITransactionPromoter promoter)
DistributedDependentTransaction _abortingDependentClone
DistributedDependentTransaction _phase0WaveDependentClone
static TransactionStateNonCommittablePromoted TransactionStateNonCommittablePromoted
static TransactionStateSubordinateActive TransactionStateSubordinateActive
static TransactionStateDelegatedSubordinate TransactionStateDelegatedSubordinate
static TransactionStatePromoted TransactionStatePromoted
static TransactionStateActive TransactionStateActive
override string ToString()
Definition Guid.cs:695
static readonly Guid Empty
Definition Guid.cs:86