예제 #1
0
void	MemoryClass<D>::pop(void)
{
	if (cont_size == 0)
		throw (PopException());
	else
	{
		data[cont_size].~D();
		cont_size--;
	}
}
예제 #2
0
    void CMultiTaskHandler::BlockUntilTaskQueueEmpty()
    {
        //if( m_NoTasksYet ) //If we never had a single task, don't bother
        //    return;

        while( ! m_tasks.empty() )
        {
            //Look for exceptions
            exception_ptr excep = PopException();
            if( excep != nullptr )
                std::rethrow_exception(excep);

            //Check if we should abort + wait
            {
                unique_lock<mutex> ulock( m_mutexTaskFinished );
                if( m_lastTaskFinished.wait_for( ulock, DUR_WAIT_TASKS_COMPLETE ) == cv_status::no_timeout )
                    return;
            }
            this_thread::yield();
        }
    }