internal void BroadcastInDoubt(ref VolatileEnlistmentSet volatiles)
 {
     for (int i = 0; i < volatiles.volatileEnlistmentCount; i++)
     {
         volatiles.volatileEnlistments[i].twoPhaseState.InternalIndoubt(volatiles.volatileEnlistments[i]);
     }
 }
 internal void BroadcastRollback(ref VolatileEnlistmentSet volatiles)
 {
     for (int i = 0; i < volatiles.volatileEnlistmentCount; i++)
     {
         volatiles.volatileEnlistments[i].twoPhaseState.InternalAborted(volatiles.volatileEnlistments[i]);
     }
 }
Beispiel #3
0
 internal void BroadcastRollback(ref VolatileEnlistmentSet volatiles)
 {
     for (int i = 0; i < volatiles.volatileEnlistmentCount; i++)
     {
         volatiles.volatileEnlistments[i].twoPhaseState.InternalAborted(volatiles.volatileEnlistments[i]);
     }
 }
Beispiel #4
0
 internal void BroadcastInDoubt(ref VolatileEnlistmentSet volatiles)
 {
     for (int i = 0; i < volatiles.volatileEnlistmentCount; i++)
     {
         volatiles.volatileEnlistments[i].twoPhaseState.InternalIndoubt(volatiles.volatileEnlistments[i]);
     }
 }
Beispiel #5
0
 internal void BroadcastInDoubt(ref VolatileEnlistmentSet volatiles)
 {
     // Broadcast preprepare to the volatile subordinates
     for (int i = 0; i < volatiles._volatileEnlistmentCount; i++)
     {
         volatiles._volatileEnlistments[i]._twoPhaseState.InternalIndoubt(
             volatiles._volatileEnlistments[i]);
     }
 }
 // This broadcast is used by the state machines and therefore must be internal.
 internal static void BroadcastRollback(ref VolatileEnlistmentSet volatiles)
 {
     // Broadcast preprepare to the volatile subordinates
     for (int i = 0; i < volatiles._volatileEnlistmentCount; i++)
     {
         volatiles._volatileEnlistments[i]._twoPhaseState !.InternalAborted(
             volatiles._volatileEnlistments[i]);
     }
 }
 internal void BroadcastInDoubt( ref VolatileEnlistmentSet volatiles )
 {
     // Broadcast preprepare to the volatile subordinates
     for ( int i = 0; i < volatiles.volatileEnlistmentCount; i++ )
     {
         volatiles.volatileEnlistments[i].twoPhaseState.InternalIndoubt( 
             volatiles.volatileEnlistments[i]);
     }
 }
 // This broadcast is used by the state machines and therefore must be internal.
 internal void BroadcastRollback(ref VolatileEnlistmentSet volatiles)
 {
     // Broadcast preprepare to the volatile subordinates
     for (int i = 0; i < volatiles._volatileEnlistmentCount; i++)
     {
         volatiles._volatileEnlistments[i]._twoPhaseState.InternalAborted(
             volatiles._volatileEnlistments[i]);
     }
 }
Beispiel #9
0
 internal void BroadcastCommitted(ref VolatileEnlistmentSet volatiles)
 {
     // Broadcast preprepare to the volatile subordinates
     for (int i = 0; i < volatiles.volatileEnlistmentCount; i++)
     {
         volatiles.volatileEnlistments[i].twoPhaseState.InternalCommitted(
             volatiles.volatileEnlistments[i]);
     }
 }
 protected void AddVolatileEnlistment(ref VolatileEnlistmentSet enlistments, Enlistment enlistment)
 {
     if (enlistments.volatileEnlistmentCount == enlistments.volatileEnlistmentSize)
     {
         InternalEnlistment[] destinationArray = new InternalEnlistment[enlistments.volatileEnlistmentSize + 8];
         if (enlistments.volatileEnlistmentSize > 0)
         {
             Array.Copy(enlistments.volatileEnlistments, destinationArray, enlistments.volatileEnlistmentSize);
         }
         enlistments.volatileEnlistmentSize += 8;
         enlistments.volatileEnlistments = destinationArray;
     }
     enlistments.volatileEnlistments[enlistments.volatileEnlistmentCount] = enlistment.InternalEnlistment;
     enlistments.volatileEnlistmentCount++;
     VolatileEnlistmentState._VolatileEnlistmentActive.EnterState(enlistments.volatileEnlistments[enlistments.volatileEnlistmentCount - 1]);
 }
Beispiel #11
0
 protected void AddVolatileEnlistment(ref VolatileEnlistmentSet enlistments, Enlistment enlistment)
 {
     if (enlistments.volatileEnlistmentCount == enlistments.volatileEnlistmentSize)
     {
         InternalEnlistment[] destinationArray = new InternalEnlistment[enlistments.volatileEnlistmentSize + 8];
         if (enlistments.volatileEnlistmentSize > 0)
         {
             Array.Copy(enlistments.volatileEnlistments, destinationArray, enlistments.volatileEnlistmentSize);
         }
         enlistments.volatileEnlistmentSize += 8;
         enlistments.volatileEnlistments     = destinationArray;
     }
     enlistments.volatileEnlistments[enlistments.volatileEnlistmentCount] = enlistment.InternalEnlistment;
     enlistments.volatileEnlistmentCount++;
     VolatileEnlistmentState._VolatileEnlistmentActive.EnterState(enlistments.volatileEnlistments[enlistments.volatileEnlistmentCount - 1]);
 }
Beispiel #12
0
 protected bool PromotePhaseVolatiles(InternalTransaction tx, ref VolatileEnlistmentSet volatiles, bool phase0)
 {
     if ((volatiles.volatileEnlistmentCount + volatiles.dependentClones) > 0)
     {
         if (phase0)
         {
             volatiles.VolatileDemux = new Phase0VolatileDemultiplexer(tx);
         }
         else
         {
             volatiles.VolatileDemux = new Phase1VolatileDemultiplexer(tx);
         }
         volatiles.VolatileDemux.oletxEnlistment = tx.PromotedTransaction.EnlistVolatile(volatiles.VolatileDemux, phase0 ? EnlistmentOptions.EnlistDuringPrepareRequired : EnlistmentOptions.None);
     }
     return(true);
 }
Beispiel #13
0
        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;
        }
Beispiel #14
0
        protected void AddVolatileEnlistment(ref VolatileEnlistmentSet enlistments, Enlistment enlistment)
        {
            // Grow the enlistment array if necessary.
            if (enlistments._volatileEnlistmentCount == enlistments._volatileEnlistmentSize)
            {
                InternalEnlistment[] newEnlistments =
                    new InternalEnlistment[enlistments._volatileEnlistmentSize + InternalTransaction.VolatileArrayIncrement];

                if (enlistments._volatileEnlistmentSize > 0)
                {
                    Array.Copy(
                        enlistments._volatileEnlistments,
                        newEnlistments,
                        enlistments._volatileEnlistmentSize
                        );
                }

                enlistments._volatileEnlistmentSize += InternalTransaction.VolatileArrayIncrement;
                enlistments._volatileEnlistments = newEnlistments;
            }

            // Add a new element to the end of the list
            enlistments._volatileEnlistments[enlistments._volatileEnlistmentCount] = enlistment.InternalEnlistment;
            enlistments._volatileEnlistmentCount++;

            // Make it's state active.
            VolatileEnlistmentState.VolatileEnlistmentActive.EnterState(
                enlistments._volatileEnlistments[enlistments._volatileEnlistmentCount - 1]);
        }