private void RemoveFromWait(AwaitingTask task) { lock (_waitList) { if (_waitList.Contains(task)) { _waitList.Remove(task); } } }
private AwaitingTask RegisterWait(string expectedResponse, int timeout) { AwaitingTask task = new AwaitingTask(expectedResponse, timeout); lock (_waitList) { _waitList.Add(task); } return(task); }