public void DeregisterLITransactionHandler(LocallyInitializedTransactionHandler th) { LocallyInitializedTransactionHandler removedLith = null; while (removedLith == null) { m_liTransactions.TryRemove(th.TransactionId, out removedLith); } Trace.Assert(removedLith == th); Thread.MemoryBarrier(); m_locallyInitiatedUidSet.GiveUniqueID(th.TransactionId); // Thread Safe, goes after removal }
public void RegisterAndInitializeLITransactionHandler(LocallyInitializedTransactionHandler th) { m_liTransactions.AddOrUpdate(th.TransactionId, th, (key, existingValue) => { throw new InvalidOperationException("TransactionID already existed!"); }); th.InitializeInteraction(this); }