internal static void ProcessExistingTransactions(TransactionStartedEventHandler eventHandler)
{
lock (PromotedTransactionTable)
{
// Manual use of IDictionaryEnumerator instead of foreach to avoid DictionaryEntry box allocations.
IDictionaryEnumerator e = PromotedTransactionTable.GetEnumerator();
while (e.MoveNext())
{
WeakReference weakRef = (WeakReference)e.Value;
Transaction tx = (Transaction)weakRef.Target;
if (tx != null)
{
TransactionEventArgs args = new TransactionEventArgs();
args._transaction = tx.InternalClone();
eventHandler(args._transaction, args);
}
}
}
}