internal void AddReference(ref MessageRpc rpc, Transaction tx, bool updateCallCount) { lock (this.mutex) { if (this.pending == null) { this.pending = new Dictionary <Transaction, RemoveReferenceRM>(); } if (tx != null) { RemoveReferenceRM erm; if (this.pending == null) { this.pending = new Dictionary <Transaction, RemoveReferenceRM>(); } if (!this.pending.TryGetValue(tx, out erm)) { RemoveReferenceRM erm2 = new RemoveReferenceRM(this.instanceContext, tx, rpc.Operation.Name) { CallCount = 1L }; this.pending.Add(tx, erm2); } else if (updateCallCount) { erm.CallCount += 1L; } } } }
internal void AddReference(ref MessageRpc rpc, Transaction tx, bool updateCallCount) { lock (this.mutex) { if (this.pending == null) { this.pending = new Dictionary<Transaction, RemoveReferenceRM>(); } if (tx != null) { RemoveReferenceRM erm; if (this.pending == null) { this.pending = new Dictionary<Transaction, RemoveReferenceRM>(); } if (!this.pending.TryGetValue(tx, out erm)) { RemoveReferenceRM erm2 = new RemoveReferenceRM(this.instanceContext, tx, rpc.Operation.Name) { CallCount = 1L }; this.pending.Add(tx, erm2); } else if (updateCallCount) { erm.CallCount += 1L; } } } }