internal void Add(TdsContext context) { if (context.TimeoutLink != null) ((RequestTimeoutEntry)context.TimeoutLink).IncrementCount(); else { var entry = new RequestTimeoutEntry(context); var index = _currentList++; if (index >= _lists.Length) { index = 0; _currentList = 0; } entry.AddToList(_lists[index]); Interlocked.Increment(ref _requestCount); context.TimeoutLink = entry; } }
internal TdsRequest(TdsListenerContext wr, TdsContext context) { _wr = wr; _context = context; }
internal void Remove(TdsContext context) { var timeoutLink = (RequestTimeoutEntry)context.TimeoutLink; if (timeoutLink != null) { if (timeoutLink.DecrementCount() != 0) return; timeoutLink.RemoveFromList(); Interlocked.Decrement(ref _requestCount); } context.TimeoutLink = null; }
internal RequestTimeoutEntry(TdsContext context) { _context = context; _count = 1; }