From afda9ce4460e4ef6014cf1de9f1ea72dcaa6cf4d Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 9 Dec 2017 13:30:25 -0800 Subject: [PATCH] add assertion --- xwords4/relay/tpool.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xwords4/relay/tpool.cpp b/xwords4/relay/tpool.cpp index 3ea401022..8abd16277 100644 --- a/xwords4/relay/tpool.cpp +++ b/xwords4/relay/tpool.cpp @@ -120,6 +120,7 @@ void XWThreadPool::AddSocket( SockType stype, QueueCallback proc, const AddrInfo* from ) { from->ref(); + int sock = from->getSocket(); logf( XW_LOGVERBOSE0, "%s(sock=%d, isTCP=%d)", __func__, sock, from->isTCP() ); SockInfo si = { .m_type = stype, @@ -128,6 +129,7 @@ XWThreadPool::AddSocket( SockType stype, QueueCallback proc, const AddrInfo* fro }; { RWWriteLock ml( &m_activeSocketsRWLock ); + assert( m_activeSockets.find( sock ) == m_activeSockets.end() ); m_activeSockets.insert( pair( sock, si ) ); } interrupt_poll();