Ejemplo n.º 1
0
//--------------------------------------------------------------------------
VeRenderNodeData::~VeRenderNodeData()
{
	m_kTickList.BeginIterator();
	while(!m_kTickList.IsEnd())
	{
		VeRenderTick* pkTick = m_kTickList.GetIterNode()->m_tContent;
		m_kTickList.Next();
		VE_DELETE(pkTick);
	}
	VE_ASSERT(m_kTickList.Empty());

	m_kCallList.BeginIterator();
	while(!m_kCallList.IsEnd())
	{
		VeRenderCall* pkCall = m_kCallList.GetIterNode()->m_tContent;
		m_kCallList.Next();
		VE_DELETE(pkCall);
	}
	VE_ASSERT(m_kCallList.Empty());
}
Ejemplo n.º 2
0
//--------------------------------------------------------------------------
void VeThread::TermPerThread() noexcept
{
#	ifdef VE_USE_THREAD_LOCAL
	VE_SAFE_DELETE(s_pkSingleton);
#	else
	VE_DELETE((VeThreadLocalSingleton*)pthread_getspecific(s_keySingleton));
#	ifdef VE_MEM_DEBUG
	delete (vtd::vector<VeDeleteCallParams>*)pthread_getspecific(g_keyDeleteStack);
#	endif
#	endif
}
Ejemplo n.º 3
0
//--------------------------------------------------------------------------
bool EntityS::Unload()
{
	if(m_pkCache)
	{
		if(m_kServerNode.IsAttach(m_pkCache->m_kWildEntities))
		{
			OnUnload();
			m_pkCache->m_kIndexMap.Remove(m_kIndex);
			VE_DELETE(this);
			return true;
		}
	}
	return false;
}
Ejemplo n.º 4
0
//--------------------------------------------------------------------------
VeThreadCallbackResult VE_CALLBACK VeThread::Callback(void* pvParam)
{
    ThreadParams* pkParams = (ThreadParams*)pvParam;
    Wait(pkParams->m_kEventLoop);
    while(pkParams->m_pkThis)
    {
        pkParams->m_pkThis->Run();
        pkParams->m_pkThis->m_kMutex.Lock();
        --(pkParams->m_pkThis->m_u32State);
        pkParams->m_kEventLoop.Reset();
        pkParams->m_kEvent.Set();
        pkParams->m_pkThis->m_kMutex.Unlock();
        Wait(pkParams->m_kEventLoop);
    }
    VE_DELETE(pkParams);
    return 0;
}
Ejemplo n.º 5
0
//--------------------------------------------------------------------------
VeThreadCallbackResult VeThread::Callback(void* pvParam) noexcept
{
	VeThread::InitPerThread();
	ThreadParams* pkParams = (ThreadParams*)pvParam;
	VeThread* pkClass = pkParams->m_pkThis;
	while (true)
	{
		pkParams->m_kEventLoop.wait();
		switch (pkClass->m_u32State.load(std::memory_order_relaxed))
		{
		case 1:
			pkClass->m_pfuncEntry(pkClass->m_pvData);
			pkClass->m_u32State.store(0, std::memory_order_relaxed);
			pkParams->m_kEventLoop.reset();
			pkParams->m_kEvent.set();
			continue;
		}
		break;
	}
	VE_DELETE(pkParams);
	VeThread::TermPerThread();
	return 0;
}