Added ReaderWriterLock around TcpConnection state management