void CIOBuffer::Allocator::Release( CIOBuffer *pBuffer ) { if ( !pBuffer ) { throw CException( _T("CIOBuffer::Allocator::Release()"), _T("pBuffer is null") ); } CCriticalSection::Owner lock( m_criticalSection ); OnBufferReleased(); /* * unlink from the in use list */ pBuffer->RemoveFromList(); if ( m_maxFreeBuffers == 0 || m_freeList.Count() < m_maxFreeBuffers ) { pBuffer->Empty(); /* * add to the free list */ m_freeList.PushNode( pBuffer ); } else { DestroyBuffer( pBuffer ); } }
void CIOBuffer::Allocator::Release( CIOBuffer *pBuffer) { if (!pBuffer) { throw CException(_T("CIOBuffer::Allocator::Release()"), _T("pBuffer is null")); } CCriticalSection::Owner lock(m_criticalSection); //lint -e{1933} call to unqualified virtual function OnBufferReleased(); // unlink from the in use list pBuffer->RemoveFromList(); if (m_maxFreeBuffers == 0 || m_freeList.Count() < m_maxFreeBuffers) { pBuffer->Empty(); // add to the free list m_freeList.PushNode(pBuffer); } else { DestroyBuffer(pBuffer); } }
void CIOBuffer::Allocator::Flush() { CCriticalSection::Owner lock( m_criticalSection ); while ( !m_activeList.Empty() ) { OnBufferReleased(); DestroyBuffer( m_activeList.PopNode() ); } while ( !m_freeList.Empty() ) { DestroyBuffer( m_freeList.PopNode() ); } }
void CIOBuffer::Allocator::Flush() { CCriticalSection::Owner lock(m_criticalSection); while (!m_activeList.Empty()) { //lint -e{1933} call to unqualified virtual function OnBufferReleased(); DestroyBuffer(m_activeList.PopNode()); } while (!m_freeList.Empty()) { DestroyBuffer(m_freeList.PopNode()); } }