protected bool PromotePhaseVolatiles(
InternalTransaction tx,
ref VolatileEnlistmentSet volatiles,
bool phase0)
{
if (volatiles._volatileEnlistmentCount + volatiles._dependentClones > 0)
{
if (phase0)
{
// Create a volatile demultiplexer for the transaction
volatiles.VolatileDemux = new Phase0VolatileDemultiplexer(tx);
}
else
{
// Create a volatile demultiplexer for the transaction
volatiles.VolatileDemux = new Phase1VolatileDemultiplexer(tx);
}
volatiles.VolatileDemux._promotedEnlistment = tx.PromotedTransaction.EnlistVolatile(volatiles.VolatileDemux,
phase0 ? EnlistmentOptions.EnlistDuringPrepareRequired : EnlistmentOptions.None);
}
return true;
}