add assertion

This commit is contained in:
Eric House 2017-12-09 13:30:25 -08:00
parent 530e0181e5
commit afda9ce446

View file

@ -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<int, SockInfo>( sock, si ) );
}
interrupt_poll();