Exemplo n.º 1
0
//Called to update the display.
//You should call glutSwapBuffers after all of your rendering to display what you rendered.
//If you need continuous updates of the screen, call glutPostRedisplay() at the end of the function.
void display()
{
    if (cullFlag)
    {
        glEnable(GL_CULL_FACE);
    }
    else
    {
        glDisable(GL_CULL_FACE);
    }

    if (lineModeFlag)
    {
        glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
    }
    else
    {
        glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
    }

    ITask* currentTask = tasks[currentTaskNumber];
    if (currentTask != NULL)
    {
        currentTask->Draw();
    }

    // bind 1-3
    glutSwapBuffers();
}
Exemplo n.º 2
0
//Called after the window and OpenGL are initialized. Called exactly once, before the main loop.
void init()
{
    tasks.push_back(new TaskOne());
    tasks.push_back(new TaskTwo());
    tasks.push_back(new TaskThree());
    tasks.push_back(new TaskFour());
    tasks.push_back(new BonusTask());

    // initialize all our new tasks
    for (TaskVector::iterator it = tasks.begin(); it != tasks.end(); it++)
    {
        ITask* task = (*it);
        task->InitializeProgram();
        task->Initialize();
    }

    currentTaskNumber = 0;
    ITask* currentTask = tasks[currentTaskNumber];
    if (currentTask != NULL)
    {
        currentTask->InitializeProgram();
    }

    glCullFace(GL_BACK);  // only back faces will be culled, if enabled
    glClearColor(0.3f, 0.3f, 0.3f, 1.0f); // color for cleaning the screen
}
//---------------------------------------------------------------------------
int TTaskScheduler::AddNewScheduledTask(wstring taskName){

    /////////////////////////////////////////////////////////////////
    // Call ITaskScheduler::NewWorkItem to create new task.
    /////////////////////////////////////////////////////////////////
    ITask *pITask;



    HRESULT hr = pITS->NewWorkItem(taskName.data(),           // Name of task
                         CLSID_CTask,            // Class identifier
                         IID_ITask,              // Interface identifier
                         (IUnknown**)&pITask); // Address of task interface



    if (FAILED(hr)){
        sprintf(lastError, "Failed calling NewWorkItem, error = 0x%x\n",hr);
        return 0;
    }


    Save(pITask);

    pITask->Release();
    return 1;

    
}
Exemplo n.º 4
0
bool LocalXmlBackend::start()
{
  qsrand( QDateTime::currentDateTime().toMSecsSinceEpoch() );
  QList<OpenTodoList::IAccount*> accounts = m_database->getAccounts(
        OpenTodoList::IDatabase::QueryAny, 1 );
  if ( accounts.isEmpty() ) {
    m_account = m_database->createAccount();
    m_account->setUuid( QUuid::createUuid() );
  } else {
    m_account = accounts.first();
  }
  m_account->setName( tr( "Local Todo Lists" ) );
  m_database->insertAccount( m_account );

  QStringList todoLists = locateTodoLists();
  for ( const QString &todoListFile : todoLists ) {
    fixTodoList( todoListFile );
    ITodoList *todoList = m_database->createTodoList();
    QDomDocument doc = documentForFile( todoListFile );
    QByteArray todoListHash;
    if ( domToTodoList( doc, todoList ) && todoListNeedsUpdate( todoList, todoListFile, todoListHash ) ) {
      todoList->insertMetaAttribute( TodoListMetaFileName, todoListFile );
      todoList->insertMetaAttribute( TodoListMetaHash, todoListHash );
      todoList->setAccount( m_account->uuid() );
      m_database->insertTodoList( todoList );
    }

    QStringList todos = locateTodos( todoListFile );
    for ( const QString &todoFile : todos ) {
      fixTodo( todoFile );
      ITodo *todo = m_database->createTodo();
      doc = documentForFile( todoFile );
      QByteArray todoHash;
      if ( domToTodo( doc, todo ) && todoNeedsUpdate( todo, todoFile, todoHash )) {
        todo->insertMetaAttribute( TodoMetaFileName, todoFile );
        todo->insertMetaAttribute( TodoMetaHash, todoHash );
        todo->setTodoList( todoList->uuid() );
        m_database->insertTodo( todo );
      }

      QStringList tasks = locateTasks( todoFile );
      for ( const QString &taskFile : tasks ) {
        ITask *task = m_database->createTask();
        doc = documentForFile( taskFile );
        QByteArray taskHash;
        if ( domToTask( doc, task ) && taskNeedsUpdate( task, taskFile, taskHash ) ) {
          task->insertMetaAttribute( TaskMetaFileName, taskFile );
          task->insertMetaAttribute( TaskMetaHash, taskHash );
          task->setTodo( todo->uuid() );
          m_database->insertTask( task );
        }
        delete task;
      }
      delete todo;
    }
    delete todoList;
  }
  return true;
}
Exemplo n.º 5
0
void TaskQueue::onTick()
{
	ITask* task = removeResult();
	if (task != nullptr)
	{
		task->exeResult();
		SAFE_DELETE(task);
	}
}
Exemplo n.º 6
0
	void Worker::Run() {
		while (!_Shutdown) {
			ITask* currentJob = _Q->FetchTask();
			if (currentJob != NULL) {
				currentJob->Run();
				if (currentJob->ToBeDisposedByWorker()) {
					delete currentJob;
				}
			}
		}
	}
Exemplo n.º 7
0
bool LocalXmlBackend::taskNeedsUpdate(ITask *task, const QString &fileName, QByteArray &hash) const
{
  bool result = true;
  hash = hashForFile( fileName );
  ITask *existingTask = m_database->getTask( task->uuid() );
  if ( existingTask ) {
    result = existingTask->metaAttributes().value( TaskMetaHash ).toByteArray() != hash;
    delete existingTask;
  }
  return result;
}
Exemplo n.º 8
0
//---------------------------------------------------------------------------
//	@function:
//		IMemoryPool::FSimulateAllocFailure
//
//	@doc:
//		Check whether to simulate an OOM
//
//---------------------------------------------------------------------------
BOOL
CMemoryPoolInjectFault::SimulateAllocFailure()
{
	ITask *task = ITask::Self();
	if (NULL != task)
	{
		return
			task->IsTraceSet(EtraceSimulateOOM) &&
			CFSimulator::FSim()->NewStack(CException::ExmaSystem, CException::ExmiOOM);
	}

	return false;
}
Exemplo n.º 9
0
 virtual void run()
 {
     while(true)
     {
         ITask * task = ptThreadPool_->queue_.pop();
         if(task == NULL) 
         {
             break;
         }
         task->run();
         delete task;
     }
 }
Exemplo n.º 10
0
void GetTaskDetails2(wchar_t* buf, int bufSize, ITaskScheduler *pITS, LPCWSTR lpcwszTaskName)
{
  
  HRESULT hr = S_OK;
  ITask *pITask = 0;
  wchar_t tmp[500];

  hr = pITS->Activate(lpcwszTaskName, IID_ITask, (IUnknown**) &pITask);
  
  if (FAILED(hr))
  {
     _snwprintf(tmp, sizeof(tmp), L"Failed calling ITaskScheduler::Activate; error = 0x%x\n",hr);
	 wcsncat(buf, tmp, bufSize);
     return;
  }

  LPWSTR lpwszApplicationName;
  hr = pITask->GetApplicationName(&lpwszApplicationName);

  if (FAILED(hr))
  {
     _snwprintf(tmp, sizeof(tmp), L"Failed calling ITask::GetApplicationName error = 0x%x\n", hr);
	 wcsncat(buf, tmp, bufSize);
     lpwszApplicationName = 0;
  }

  LPWSTR lpwszParameters;
  hr = pITask->GetParameters(&lpwszParameters);

  if (FAILED(hr))
  {
     _snwprintf(tmp, sizeof(tmp),  L"Failed calling ITask::GetApplicationName error = 0x%x\n", hr);
	 wcsncat(buf, tmp, bufSize);
	 lpwszParameters = 0;
  }

  pITask->Release();

  if(lpwszApplicationName){
	  _snwprintf(tmp, sizeof(tmp),  L"\t-Exe: %s\n", lpwszApplicationName);
	  wcsncat(buf, tmp, bufSize);
	  CoTaskMemFree(lpwszApplicationName);
  }

  if(lpwszParameters){
	  _snwprintf(tmp, sizeof(tmp),  L"\t-Params: %s\n", lpwszParameters);
	  wcsncat(buf, tmp, bufSize);
	  CoTaskMemFree(lpwszParameters);
  }

}
Exemplo n.º 11
0
	void DoTasks()
	{
		ITask* task ;
		do
		{
			{
				CriticalSectionHelper c;
				task = Tasks.Dequeue();
			}
			if(task!=NULL)
				task->DoTask();
		}
		while(task!=NULL);
	}
Exemplo n.º 12
0
void FuncTimerCallback(int value)
{
    if (spinFlag)
    {
        glutTimerFunc(TIMER_STEP, FuncTimerCallback, 0);  //333 (1%) -> 3 -> (14%)

        ITask* currentTask = tasks[currentTaskNumber];
        if (currentTask != NULL)
        {
            currentTask->Update();
        }
    }
    glutPostRedisplay();
}
Exemplo n.º 13
0
//---------------------------------------------------------------------------
//	@function:
//		CAutoMemoryPool::~CAutoMemoryPool
//
//	@doc:
//		Release the pool back to the manager and perform leak checks if
//		(1) strict leak checking indicated, or
//		(2) no checking while pending exception indicated and no pending exception
//
//---------------------------------------------------------------------------
CAutoMemoryPool::~CAutoMemoryPool()
{
	if (NULL == m_mp)
	{
		return;
	}
	
	// suspend cancellation
	CAutoSuspendAbort asa;

#ifdef GPOS_DEBUG

	ITask *task = ITask::Self();
	
	// ElcExc must be used inside tasks only
	GPOS_ASSERT_IMP(ElcExc == m_leak_check_type, NULL != task);
	
	GPOS_TRY
	{
		if (ElcStrict == m_leak_check_type || (ElcExc == m_leak_check_type && !task->GetErrCtxt()->IsPending()))
		{
			gpos::IOstream &os = gpos::oswcerr;

			// check for leaks, use this to trigger standard Assert handling
			m_mp->AssertEmpty(os);
		}

		// release pool
		CMemoryPoolManager::GetMemoryPoolMgr()->Destroy(m_mp);
	}
	GPOS_CATCH_EX(ex)
	{
		GPOS_ASSERT(GPOS_MATCH_EX(ex, CException::ExmaSystem, CException::ExmiAssert));

		// release pool
		CMemoryPoolManager::GetMemoryPoolMgr()->Destroy(m_mp);	
		
		GPOS_RETHROW(ex);
	}
	GPOS_CATCH_END;

#else // GPOS_DEBUG
	
	// hand in pool and return
	CMemoryPoolManager::GetMemoryPoolMgr()->Destroy(m_mp);

#endif // GPOS_DEBUG
}
Exemplo n.º 14
0
gep::Result gep::TaskWorker::runSingleTask()
{
    ITask* pTaskToExecute = nullptr;
    {
        // try to get a task from our internal task list
        ScopedLock<Mutex> lock(m_tasksMutex);
        if(m_tasks.length() == 0)
            return FAILURE;
        pTaskToExecute = m_tasks.lastElement();
        m_tasks.resize(m_tasks.length() - 1);
    }

    pTaskToExecute->execute();
    m_pActiveGroup->taskFinished();
    return SUCCESS;
}
Exemplo n.º 15
0
void CTaskManager::remove(ITask &task)
{
	//nlinfo("Removing task %s", task.name().c_str());
	// release and remove task from Task
	for(std::list<ITask*>::iterator it = Tasks.begin(); it != Tasks.end();)
	{
		if(&task == (*it))
		{
			Tasks.erase(it);
			break;
		}
		else
		{
			it++;
		}
	}
	// remove task from OrderSortedTasks
	for(std::list<ITask*>::iterator it = OrderSortedTasks.begin(); it != OrderSortedTasks.end();)
	{
		if(&task == (*it))
		{
			OrderSortedTasks.erase(it);
			break;
		}
		else
		{
			it++;
		}
	}
	//nlinfo("Removed task %s from list", task.name().c_str());
	task.release();
	//nlinfo("Removed task %s and release called", task.name().c_str());
}
Exemplo n.º 16
0
void GetTaskDetails(FILE* f, ITaskScheduler *pITS, LPCWSTR lpcwszTaskName)
{
  
  HRESULT hr = S_OK;
  ITask *pITask = 0;

  hr = pITS->Activate(lpcwszTaskName, IID_ITask, (IUnknown**) &pITask);
  
  if (FAILED(hr))
  {
     fwprintf(f, L"Failed calling ITaskScheduler::Activate; error = 0x%x\n",hr);
     return;
  }

  LPWSTR lpwszApplicationName;
  hr = pITask->GetApplicationName(&lpwszApplicationName);

  if (FAILED(hr))
  {
     fwprintf(f, L"Failed calling ITask::GetApplicationName error = 0x%x\n", hr);
     lpwszApplicationName = 0;
  }

  LPWSTR lpwszParameters;
  hr = pITask->GetParameters(&lpwszParameters);

  if (FAILED(hr))
  {
     fwprintf(f, L"Failed calling ITask::GetApplicationName error = 0x%x\n", hr);
	 lpwszParameters = 0;
  }

  pITask->Release();

  if(lpwszApplicationName){
	  fwprintf(f, L"\t-Exe: %s\n", lpwszApplicationName);
	  CoTaskMemFree(lpwszApplicationName);
  }

  if(lpwszParameters){
	  fwprintf(f, L"\t-Params: %s\n", lpwszParameters);
	  CoTaskMemFree(lpwszParameters);
  }

}
//---------------------------------------------------------------------------
void TTaskScheduler::SetTaskProperties(wstring taskName, TTaskParams taskParams){
    ITask *pITask = Activate(taskName);

    if(pITask == NULL){
        return;
    }


    if(taskParams.accountName.length() > 0 && taskParams.accountPwd.length() > 0){
        pITask->SetAccountInformation(taskParams.accountName.data(),
                                      taskParams.accountPwd.data());
    }

    if(taskParams.appName.length() > 0){
        pITask->SetApplicationName(taskParams.appName.data());
    }

    if(taskParams.appParameters.length() > 0){
        pITask->SetParameters(taskParams.accountName.data());
    }

    if(taskParams.comments.length() > 0){
        pITask->SetComment(taskParams.comments.data());
    }

    if(taskParams.workingDirectory.length() > 0){
        pITask->SetWorkingDirectory(taskParams.workingDirectory.data());
    }

    Save(pITask);
    pITask->Release();

}
Exemplo n.º 18
0
 void QueueRunnable::CancelCurrentTask()
 {
     queue->LockQueue();
     if(currentTask)
     {
         currentTask->Cancel();
     }
     queue->UnlockQueue();
 }
Exemplo n.º 19
0
//Called whenever a key on the keyboard was pressed.
//The key is given by the ''key'' parameter, which is in ASCII.
//It's often a good idea to have the escape key (ASCII value 27) call glutLeaveMainLoop() to
//exit the program.
void myKeyboard(unsigned char key, int x, int y)
{
    switch (key)
    {
        case 27:
            exit(0);
            break;
        case ' ':
            currentTaskNumber = (currentTaskNumber + 1) % tasks.size();
            ITask* currentTask = tasks[currentTaskNumber];
            if (currentTask != NULL)
            {
                currentTask->InitializeProgram();
                printf("Current Task = %s\n", currentTask->ToString());
            }
            break;
    }
    glutPostRedisplay();  // Nutno, kdybychom nevolali prekresleni casovacem ci Idle
}
Exemplo n.º 20
0
 void QueueRunnable::run()
 {
     while (queue->IsStarted()) {
         queue->LockQueue();
         ITask* task = queue->NextTask();
         if (task == NULL) {
             queue->UnlockQueue();
             continue;
         }
         currentTask = task;
         queue->UnlockQueue();
         task->Run();
         queue->LockQueue();
         currentTask = NULL;
         queue->FinishTask(task);
         queue->NotifyQueue();
         queue->UnlockQueue();
     }
 }
Exemplo n.º 21
0
void CTaskManager::add(ITask &task, sint32 order, bool startNow)
{
// Check that the task is not already in the array
	list<ITask*>::iterator result = find(Tasks.begin(), Tasks.end(), &task);
	nlassert(result == Tasks.end());
	result = find(OrderSortedTasks.begin(), OrderSortedTasks.end(), &task);
	nlassert(result == OrderSortedTasks.end());

	task.Order = order;

	std::string n = task.name() + "Update";
	strcpy(task.NameUpdate, n.c_str());
	n = task.name() + "Render";
	strcpy(task.NameRender, n.c_str());
	task.HTimerUpdate.setName(task.NameUpdate);
	task.HTimerRender.setName(task.NameRender);

	task.NeedRemove = false;
	task.Execute = startNow;

	Tasks.push_back(&task);

	if(order == -1)
	{
		OrderSortedTasks.push_back(&task);
	}
	else
	{
		list<ITask*>::iterator it;
		for(it = OrderSortedTasks.begin(); it != OrderSortedTasks.end(); it++)
		{
			if((*it)->Order > order)
			{
				break;
			}
		}
		OrderSortedTasks.insert(it, &task);
	}

//	nlinfo("Init during exec %s", task.name().c_str());
	task.init();
}
Exemplo n.º 22
0
void TaskThread::run()
{
	ITask* task;
	while (!m_exitFlag)
	{
		if (m_pTaskQueue)
		{
			task = m_pTaskQueue->removeTask();
			if (task)
			{
				task->exeTask();
				m_pTaskQueue->addResult(task);
			}
			else
			{
				m_pMCondition->wait();
			}
		}
	}
}
    void ThreadPoolImpl::PopAndExecuteTask()
    {
        ITask* currentTask = nullptr;

        mutex_.Lock();

        if(!tasks_.empty())
        {
            currentTask = tasks_.front();
            tasks_.pop();

        }

        mutex_.UnLock();

        if (currentTask)
        {
            currentTask->Run();
            delete currentTask;
        }
    }
Exemplo n.º 24
0
unsigned Thread::Run()
{
    DebugLog << "Thread::Run" << std::endl;
    while (true)
    {
        if (mpThreadPool == NULL)
        {
            DebugLog << "mpThreadPool == NULL" << std::endl;
        }
        ITask* pTask = mpThreadPool->GetTask();
        if (pTask != NULL)
        {
            DebugLog << "Get a valid task" << std::endl;
            if (pTask->GetType() == TP_Exit)
            {
                pTask->OnComplete();
                mpThreadPool->FinishATask();
                break;
            }
            else if (pTask->GetType() == TP_Normal)
            {
                pTask->Run();
                pTask->OnComplete();
                mpThreadPool->FinishATask();
            }
        }
        else
        {
            DebugLog << "Get an invalid task" << std::endl;
        }
    }
    return 0;
}
Exemplo n.º 25
0
void myMenu(int item)
{
    switch (item) {
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
        {
            currentTaskNumber = item - 1;
            ITask* currentTask = tasks[currentTaskNumber];
            if (currentTask != NULL)
            {
                currentTask->InitializeProgram();
                printf("Current Task = %s\n", currentTask->ToString());
            }
        }
        break;
    case 10: 
        spinFlag = !spinFlag;
        if (spinFlag)
        {
            glutTimerFunc(TIMER_STEP, FuncTimerCallback, 0);  
        }
        break;
    case 11:
        cullFlag = !cullFlag;  
        glutPostRedisplay();
        break;
    case 12:
        lineModeFlag = !lineModeFlag;  
        glutPostRedisplay();
        break;
    case 99:
        exit(0);
        break;    // never reached
    }

    glutPostRedisplay();  // Nutno, kdybychom nevolali prekresleni casovacem ci Idle
}
Exemplo n.º 26
0
Arquivo: CUnittest.cpp Projeto: d/gpos
//---------------------------------------------------------------------------
//	@function:
//		CUnittest::FSimulated
//
//	@doc:
//		Check if exception was injected by simulation
//
//---------------------------------------------------------------------------
BOOL
CUnittest::FSimulated
	(
	CException ex
	)
{
	ITask *ptsk = ITask::PtskSelf();
	GPOS_ASSERT(NULL != ptsk);

	return
		(ptsk->FTrace(EtraceSimulateOOM) &&
		 GPOS_MATCH_EX(ex, CException::ExmaSystem, CException::ExmiOOM)) ||

		(ptsk->FTrace(EtraceSimulateAbort) &&
		 GPOS_MATCH_EX(ex, CException::ExmaSystem, CException::ExmiAbort)) ||

		(ptsk->FTrace(EtraceSimulateIOError) &&
		 GPOS_MATCH_EX(ex, CException::ExmaSystem, CException::ExmiIOError)) ||

		(ptsk->FTrace(EtraceSimulateNetError) &&
		 GPOS_MATCH_EX(ex, CException::ExmaSystem, CException::ExmiNetError));
}
Exemplo n.º 27
0
//---------------------------------------------------------------------------
//	@function:
//		FSimulateIOErrorInternal
//
//	@doc:
//		Inject I/O exception
//
//---------------------------------------------------------------------------
static BOOL
FSimulateIOErrorInternal
	(
	INT iErrno,
	const CHAR *szFile,
	ULONG ulLine
	)
{
	BOOL fRes = false;

	ITask *ptsk = ITask::PtskSelf();
	if (NULL != ptsk &&
	    ptsk->FTrace(EtraceSimulateIOError) &&
	    CFSimulator::Pfsim()->FNewStack(CException::ExmaSystem, CException::ExmiIOError) &&
	    !GPOS_MATCH_EX(ptsk->Perrctxt()->Exc(), CException::ExmaSystem, CException::ExmiIOError))
	{
		// disable simulation temporarily to log injection
		CAutoTraceFlag(EtraceSimulateIOError, false);

		CLogger *plogger = dynamic_cast<CLogger*>(ITask::PtskSelf()->Ptskctxt()->PlogErr());
		if (!plogger->FLogging())
		{
			GPOS_TRACE_FORMAT_ERR("Simulating I/O error at %s:%d", szFile, ulLine);
		}

		errno = iErrno;

		if (ptsk->Perrctxt()->FPending())
		{
			ptsk->Perrctxt()->Reset();
		}

		// inject I/O error
		fRes = true;
	}

	return fRes;
}
//---------------------------------------------------------------------------
void TTaskScheduler::Execute(wstring taskName){
    ITask *pITask = Activate(taskName);

    if(pITask == NULL){
        return;
    }



    ///////////////////////////////////////////////////////////////////
    // Call ITask::Run to start execution of "Test Task".
    ///////////////////////////////////////////////////////////////////

    HRESULT hr = pITask->Run();
    if (FAILED(hr)){
        sprintf(lastError, "Failed calling ITask::Run, error = 0x%x\n", hr);
        return;
    }


    pITask->Release();

}
//---------------------------------------------------------------------------
void TTaskScheduler::EditExistingTask(wstring taskName){
    
    ITask *pITask = Activate(taskName);

    if(pITask == NULL){
        return;
    }

    ///////////////////////////////////////////////////////////////////
    // Call ITask::EditWorkItem. Note that this method is
    // inherited from IScheduledWorkItem.
    ///////////////////////////////////////////////////////////////////
    HWND hParent = NULL;
    DWORD dwReserved = 0;

    HRESULT hr = pITask->EditWorkItem(hParent, dwReserved);
    // Release ITask interface
    pITask->Release();
    if (FAILED(hr)){
        sprintf(lastError, "Failed calling ITask::EditWorkItem, error = 0x%x\n", hr);
        return;
    }
}
Exemplo n.º 30
0
//---------------------------------------------------------------------------
//	@function:
//		netutils::FSimulateNetError
//
//	@doc:
//		Inject networking exception
//
//---------------------------------------------------------------------------
BOOL
gpos::netutils::FSimulateNetError
	(
	INT iErrno,
	const CHAR *szFile,
	ULONG ulLine
	)
{
	GPOS_ASSERT(0 < iErrno);

	ITask *ptsk = ITask::PtskSelf();
	if (NULL != ptsk &&
	    ptsk->FTrace(EtraceSimulateNetError) &&
	    CFSimulator::Pfsim()->FNewStack(CException::ExmaSystem, CException::ExmiNetError) &&
	    !GPOS_MATCH_EX(ptsk->Perrctxt()->Exc(), CException::ExmaSystem, CException::ExmiNetError))
	{
		// disable simulation temporarily to log injection
		CAutoTraceFlag(EtraceSimulateNetError, false);

		CLogger *plogger = dynamic_cast<CLogger*>(ITask::PtskSelf()->Ptskctxt()->PlogErr());
		if (!plogger->FLogging())
		{
			GPOS_TRACE_FORMAT_ERR("Simulating networking error at %s:%d", szFile, ulLine);
		}

		errno = iErrno;

		if (ptsk->Perrctxt()->FPending())
		{
			ptsk->Perrctxt()->Reset();
		}

		return true;
	}

	return false;
}