Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TransactionStatePromotedBase.cs
Go to the documentation of this file.
3
4namespace System.Transactions;
5
7{
9 {
10 return TransactionStatus.Active;
11 }
12
13 internal override Enlistment EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
14 {
15 Monitor.Exit(tx);
16 try
17 {
18 Enlistment enlistment = new Enlistment(enlistmentNotification, tx, atomicTransaction);
20 enlistment.InternalEnlistment.PromotedEnlistment = tx.PromotedTransaction.EnlistVolatile(enlistment.InternalEnlistment, enlistmentOptions);
21 return enlistment;
22 }
23 finally
24 {
25 Monitor.Enter(tx);
26 }
27 }
28
29 internal override Enlistment EnlistVolatile(InternalTransaction tx, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
30 {
31 Monitor.Exit(tx);
32 try
33 {
34 Enlistment enlistment = new Enlistment(enlistmentNotification, tx, atomicTransaction);
36 enlistment.InternalEnlistment.PromotedEnlistment = tx.PromotedTransaction.EnlistVolatile(enlistment.InternalEnlistment, enlistmentOptions);
37 return enlistment;
38 }
39 finally
40 {
41 Monitor.Enter(tx);
42 }
43 }
44
45 internal override Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
46 {
48 Monitor.Exit(tx);
49 try
50 {
51 Enlistment enlistment = new Enlistment(resourceManagerIdentifier, tx, enlistmentNotification, null, atomicTransaction);
53 enlistment.InternalEnlistment.PromotedEnlistment = tx.PromotedTransaction.EnlistDurable(resourceManagerIdentifier, (DurableInternalEnlistment)enlistment.InternalEnlistment, v: false, enlistmentOptions);
54 return enlistment;
55 }
56 finally
57 {
58 Monitor.Enter(tx);
59 }
60 }
61
62 internal override Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
63 {
65 Monitor.Exit(tx);
66 try
67 {
68 Enlistment enlistment = new Enlistment(resourceManagerIdentifier, tx, enlistmentNotification, enlistmentNotification, atomicTransaction);
70 enlistment.InternalEnlistment.PromotedEnlistment = tx.PromotedTransaction.EnlistDurable(resourceManagerIdentifier, (DurableInternalEnlistment)enlistment.InternalEnlistment, v: true, enlistmentOptions);
71 return enlistment;
72 }
73 finally
74 {
75 Monitor.Enter(tx);
76 }
77 }
78
79 internal override void Rollback(InternalTransaction tx, Exception e)
80 {
81 if (tx._innerException == null)
82 {
83 tx._innerException = e;
84 }
85 Monitor.Exit(tx);
86 try
87 {
89 }
90 finally
91 {
92 Monitor.Enter(tx);
93 }
94 }
95
97 {
98 if (tx != null && tx.PromotedTransaction != null)
99 {
101 }
102 return Guid.Empty;
103 }
104
105 internal override void AddOutcomeRegistrant(InternalTransaction tx, TransactionCompletedEventHandler transactionCompletedDelegate)
106 {
107 tx._transactionCompletedDelegate = (TransactionCompletedEventHandler)Delegate.Combine(tx._transactionCompletedDelegate, transactionCompletedDelegate);
108 }
109
110 internal override void BeginCommit(InternalTransaction tx, bool asyncCommit, AsyncCallback asyncCallback, object asyncState)
111 {
112 tx._asyncCommit = asyncCommit;
113 tx._asyncCallback = asyncCallback;
114 tx._asyncState = asyncState;
116 }
117
119 {
121 }
122
123 internal override bool EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction, Guid promoterType)
124 {
125 return false;
126 }
127
129 {
131 {
134 {
136 }
137 return;
138 }
141 {
142 return;
143 }
145 tx._phase0WaveDependentClone = null;
146 Monitor.Exit(tx);
147 try
148 {
149 try
150 {
151 phase0WaveDependentClone.Complete();
152 }
153 finally
154 {
155 phase0WaveDependentClone.Dispose();
156 }
157 }
158 finally
159 {
160 Monitor.Enter(tx);
161 }
162 }
163
165 {
166 if (tx._phase1Volatiles.VolatileDemux != null)
167 {
169 return;
170 }
173 {
174 return;
175 }
177 tx._abortingDependentClone = null;
178 Monitor.Exit(tx);
179 try
180 {
181 try
182 {
183 abortingDependentClone.Complete();
184 }
185 finally
186 {
187 abortingDependentClone.Dispose();
188 }
189 }
190 finally
191 {
192 Monitor.Enter(tx);
193 }
194 }
195
196 internal override void CreateBlockingClone(InternalTransaction tx)
197 {
198 if (tx._phase0WaveDependentClone == null)
199 {
200 tx._phase0WaveDependentClone = tx.PromotedTransaction.DependentClone(v: true);
201 }
203 }
204
205 internal override void CreateAbortingClone(InternalTransaction tx)
206 {
207 if (tx._phase1Volatiles.VolatileDemux != null)
208 {
210 return;
211 }
212 if (tx._abortingDependentClone == null)
213 {
214 tx._abortingDependentClone = tx.PromotedTransaction.DependentClone(v: false);
215 }
217 }
218
219 internal override bool ContinuePhase0Prepares()
220 {
221 return true;
222 }
223
225 {
227 }
228
233
235 {
237 }
238
240 {
242 }
243
244 internal override void Timeout(InternalTransaction tx)
245 {
246 try
247 {
248 if (tx._innerException == null)
249 {
250 tx._innerException = new TimeoutException(System.SR.TraceTransactionTimeout);
251 }
254 if (log.IsEnabled())
255 {
257 }
258 }
260 {
262 if (log2.IsEnabled())
263 {
265 }
266 }
267 }
268
269 internal override void Promote(InternalTransaction tx)
270 {
271 }
272
273 internal override byte[] PromotedToken(InternalTransaction tx)
274 {
275 return tx.promotedToken;
276 }
277
279 {
280 }
281
283 {
284 }
285}
static ? Delegate Combine(Delegate? a, Delegate? b)
Definition Delegate.cs:379
static string TraceTransactionTimeout
Definition SR.cs:50
Definition SR.cs:7
static void Exit(object obj)
static void Enter(object obj)
DistributedDependentTransaction DependentClone(bool v)
IPromotedEnlistment EnlistDurable(Guid resourceManagerIdentifier, DurableInternalEnlistment internalEnlistment, bool v, EnlistmentOptions enlistmentOptions)
IPromotedEnlistment EnlistVolatile(InternalEnlistment internalEnlistment, EnlistmentOptions enlistmentOptions)
static EnlistmentStatePromoted EnlistmentStatePromoted
InternalEnlistment InternalEnlistment
Definition Enlistment.cs:7
TransactionCompletedEventHandler _transactionCompletedDelegate
TransactionTraceIdentifier TransactionTraceId
DistributedDependentTransaction _abortingDependentClone
DistributedDependentTransaction _phase0WaveDependentClone
override void CompleteAbortingClone(InternalTransaction tx)
override void Rollback(InternalTransaction tx, Exception e)
override void Phase0VolatilePrepareDone(InternalTransaction tx)
override void AddOutcomeRegistrant(InternalTransaction tx, TransactionCompletedEventHandler transactionCompletedDelegate)
override void InDoubtFromEnlistment(InternalTransaction tx)
override TransactionStatus get_Status(InternalTransaction tx)
override Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
override void CompleteBlockingClone(InternalTransaction tx)
override void RestartCommitIfNeeded(InternalTransaction tx)
override void ChangeStatePromotedAborted(InternalTransaction tx)
override void ChangeStateAbortedDuringPromotion(InternalTransaction tx)
override Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
override void ChangeStatePromotedCommitted(InternalTransaction tx)
override Enlistment EnlistVolatile(InternalTransaction tx, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
override Enlistment EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
override void Phase1VolatilePrepareDone(InternalTransaction tx)
override bool EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction, Guid promoterType)
override void BeginCommit(InternalTransaction tx, bool asyncCommit, AsyncCallback asyncCallback, object asyncState)
static TransactionStatePromotedP0Wave TransactionStatePromotedP0Wave
static TransactionStateAborted TransactionStateAborted
static TransactionStatePromotedIndoubt TransactionStatePromotedIndoubt
static TransactionStatePromotedAborted TransactionStatePromotedAborted
static TransactionStatePromotedCommitting TransactionStatePromotedCommitting
static TransactionStatePromotedCommitted TransactionStatePromotedCommitted
virtual void Phase0VolatilePrepareDone(InternalTransaction tx)
void ExceptionConsumed(TraceSourceType traceSource, Exception exception)
void TransactionTimeout(TransactionTraceIdentifier transactionID)
static readonly TransactionsEtwProvider Log
delegate void TransactionCompletedEventHandler(object? sender, TransactionEventArgs e)
static readonly Guid Empty
Definition Guid.cs:86