当前位置: 首页>>代码示例>>C++>>正文


C++ Resume函数代码示例

本文整理汇总了C++中Resume函数的典型用法代码示例。如果您正苦于以下问题:C++ Resume函数的具体用法?C++ Resume怎么用?C++ Resume使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Resume函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Resume

void UploadJob::HandleOverwriteReply( Message* pcMsg )
{
	int nResponse;
	bool bPersistent = false;
	pcMsg->FindInt32( "userResponse", &nResponse );
	pcMsg->FindBool( "persistent", &bPersistent );
	if( nResponse == RESPONSE_YES ) {
		if( bPersistent ) SetOverwritePolicy( OP_OVERWRITE );
		Resume();
	} else if( nResponse == RESPONSE_NO ) {
		if( bPersistent ) SetOverwritePolicy( OP_SKIP );
		m_nStatus = STATUS_SKIPPED;
		FinaliseJob();
		if( m_pcParent ) m_pcParent->ChildTransferFinished( NULL, -1, this );
	}
	else DEBUG("UploadJob::HandleOverwriteReply: Got unexpected response %i!\n", nResponse );
}
开发者ID:PyroOS,项目名称:Pyro,代码行数:17,代码来源:job.cpp

示例2: memset

/// <summary>
/// Get WOW64 thread context
/// </summary>
/// <param name="ctx">Returned context</param>
/// <param name="flags">Context flags.</param>
/// <param name="dontSuspend">true if thread shouldn't be suspended before retrieving context</param>
/// <returns>true on success</returns>
bool Thread::GetContext( _CONTEXT32& ctx, DWORD flags /*= CONTEXT_ALL*/, bool dontSuspend /*= false*/ )
{
    bool result = false;

    memset( &ctx, 0x00, sizeof(ctx) );
    ctx.ContextFlags = flags;

    if (dontSuspend || Suspend())
    {
        result = (_core->native()->GetThreadContextT( _handle, ctx ) == STATUS_SUCCESS);

        if (!dontSuspend)
            Resume();
    }
        
    return result;
}
开发者ID:Jeswang,项目名称:mono-assembly-injector,代码行数:24,代码来源:Thread.cpp

示例3: Resume

void
nsSMILTimeContainer::Begin()
{
  Resume(PAUSE_BEGIN);
  if (mPauseState) {
    mNeedsPauseSample = PR_TRUE;
  }

  // This is a little bit complicated here. Ideally we'd just like to call
  // Sample() and force an initial sample but this turns out to be a bad idea
  // because this may mean that NeedsSample() no longer reports true and so when
  // we come to the first real sample our parent will skip us over altogether.
  // So we force the time to be updated and adopt the policy to never call
  // Sample() ourselves but to always leave that to our parent or client.

  UpdateCurrentTime();
}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:17,代码来源:nsSMILTimeContainer.cpp

示例4: Resume

// SetTo
bool
NameIndexEntryIterator::SetTo(NameIndex *index, const char *name,
							  bool ignoreValue)
{
	Resume();
	fIndex = index;
	fSuspended = false;
	fIsNext = false;
	if (fIndex) {
		if (ignoreValue) {
			fIndex->fEntries->GetIterator(&fIterator);
			return fIterator.GetCurrent();
		}
		return fIndex->fEntries->FindFirst(name, &fIterator);
	}
	return false;
}
开发者ID:looncraz,项目名称:haiku,代码行数:18,代码来源:NameIndex.cpp

示例5: assert

HRESULT CWinThread::CreateNoCRT( IWinRunnable* piRunnable )
{
	assert(!m_h);
	assert(piRunnable);
	if (m_h)
		return AtlHresultFromWin32(ERROR_ALREADY_INITIALIZED);

	if (!piRunnable)
		return E_POINTER;

	m_h = ::CreateThread(NULL, 0, RunThreadFuncNoCRT, piRunnable, CREATE_SUSPENDED, NULL);
	if (!m_h)
		return GetLastError() ? AtlHresultFromLastError() : E_FAIL;

	Resume();
	return S_OK;
}
开发者ID:wang1986one,项目名称:duipcmgr,代码行数:17,代码来源:WinThread.cpp

示例6: Start

bool
Start()
{
  if (gSession) {
    return false;
  }

  if (!LoadDTPerformanceLibrary()) {
    return false;
  }

  AutoReleased<CFStringRef> process =
    CFStringCreateWithFormat(kCFAllocatorDefault, nullptr, CFSTR("%d"),
                             getpid());
  if (!process) {
    return false;
  }
  CFErrorRef error = nullptr;
  gSession = DTPerformanceSessionCreate(nullptr, process, nullptr, &error);
  if (!gSession) {
    return Error(error);
  }

  AutoReleased<CFNumberRef> interval =
    CFNumberCreate(0, kCFNumberIntType, &kSamplingInterval);
  if (!interval) {
    return false;
  }
  CFStringRef keys[1] = { CFSTR(DTPerformanceSession_Option_SamplingInterval) };
  CFNumberRef values[1] = { interval };
  AutoReleased<CFDictionaryRef> options =
    CFDictionaryCreate(kCFAllocatorDefault, (const void**)keys,
                       (const void**)values, 1, &kCFTypeDictionaryKeyCallBacks,
                       &kCFTypeDictionaryValueCallBacks);
  if (!options) {
    return false;
  }

  if (!DTPerformanceSessionAddInstrument(gSession,
                                         CFSTR(DTPerformanceSession_TimeProfiler),
                                         options, nullptr, &error)) {
    return Error(error);
  }

  return Resume();
}
开发者ID:Romitarath,项目名称:mozilla-central,代码行数:46,代码来源:Instruments.cpp

示例7: connect

void BatchGUI::SetupConnect()
{
    connect( this->ui.addButton, SIGNAL(clicked()), this, SLOT(AddProcess()) );
    //
    connect( this->ui.beginButton, SIGNAL(clicked()), this, SLOT(BeginProcess()) );
    //
    connect( this->ui.appButton, SIGNAL(clicked()), this, SLOT(SelectFile()) );
    //
    connect( this->ui.cleanButton, SIGNAL(clicked()), this, SLOT(CleanAll()) );
    //
    connect( this->ui.stopButton, SIGNAL(clicked()), this, SLOT(StopAll()) );
    //
    connect( this->ui.resumeButton, SIGNAL(clicked()), this, SLOT(Resume()) );
    //
    connect( this->ui.resetButton, SIGNAL(clicked()), this, SLOT(ResetAll()) );
    return;
}
开发者ID:hanyuliu,项目名称:QBatchGUI,代码行数:17,代码来源:BatchGUI.cpp

示例8: Resume

void GameTable::TogglePause()
{
    if (isPaused)
    {
        isPaused = false;
        state = prevState;

        Resume();
    }
    else
    {
        isPaused = true;
        prevState = state;
        state = GameTableState::Paused;

        Pause();
    }
}
开发者ID:Farious,项目名称:GemBreaker,代码行数:18,代码来源:GameTable.cpp

示例9: GetConsoleInt

LTBOOL CLoadingScreen::Show(LTBOOL bRun)
{
	if (bRun && !GetConsoleInt("DynamicLoadScreen",1))
		bRun = LTFALSE;
	// Make sure we're in the correct state
	if (m_eCurState == STATE_NONE)
	{
		if (!Init())
			return LTFALSE;
	}

	if (m_eCurState != STATE_INIT)
		return LTFALSE;

	// Turn off the cursor
	g_pCursorMgr->UseCursor(LTFALSE);
	
	// Set up the FarZ & turn off fog (farz of 0 is bogus)

	m_nOldFarZ = GetConsoleInt("FarZ", 10000);
	m_nOldFarZ = m_nOldFarZ == 0 ? 10000 : m_nOldFarZ;

	m_bOldFogEnable = (LTBOOL) GetConsoleInt("FogEnable", 0);

	g_pGameClientShell->SetFarZ(10000);
	WriteConsoleInt("FogEnable", 0);

	// Make sure we're not in optimized 2D mode (happens sometimes...)
	g_pLTClient->EndOptimized2D();

	
	// Go into the right state..
	m_eCurState = STATE_SHOW;

	// Update once so the screen's showing
	Update();

	// Start updating if they wanted it to..
	if (bRun)
		return Resume();

	// Ok, it's visible or active
	return LTTRUE;
}
开发者ID:rickyharis39,项目名称:nolf2,代码行数:44,代码来源:LoadingScreen.cpp

示例10: PauseThread

		bool MT_Thread::StartThread(){
	
			//如果已經启动则返回
			if(m_hHandle !=NULL){
				PauseThread(false);
				Resume();
				return true;	
			}
			//不暂停
			m_bPause	= false;
			//不退出循环调用
			m_bExit		= false;
			//开始线程
			m_hHandle = (HANDLE)_beginthreadex(NULL,0,MT_Thread::Run,(void*)this,0,&m_iThreadID);
			//如果线程创建失败
			if(m_hHandle==NULL)
				return false;
			return true;
		}
开发者ID:ingeyu,项目名称:airengine,代码行数:19,代码来源:MTThread.cpp

示例11: LogError

	bool MonsterAI::BeginSkill(long skillId, long skillLvl, long x, long y, CMoveShape* target)
	{
		if (target == NULL)
		{
			LogError(AI_MODULE, "Target object is null.");
			return false;
		}

		LogDebug(AI_MODULE, "skillId=%d, skillLvl=%d, x=%d, y=%d, target=%s",
			skillId, skillLvl, x, y, target->GetExID().tostring());
		CMonster *monster = static_cast<CMonster*>(GetOwner());
		monster->InitSkillInstance(skillId, skillLvl, 0, 0, 0, NULL_GUID, 5);
		if(!BaseAI::BeginSkill(monster->GetInstanceSkill(), x, y, target))
		{
			Resume(OPER_FAILED_TIME);
			return false;
		}
		return true;
	}
开发者ID:Caoxuyang,项目名称:klcommon,代码行数:19,代码来源:MonsterAI.cpp

示例12: Clear

void PauseMenu::DoRestart()
{
	auto engine = STGEngine::GetInstance();
	auto scene = (GameScene*)Game::GetInstance()->GetScene().Get();
	scene->STGFadeOut(30);

	auto scheduler = scene->GetScheduler();
	Ptr<FrameTimer> timer = Ptr<FrameTimer>::New();
	timer->SetFrame(30);
	timer->run = [this, scene, engine]()
	{
		scene->Restart();
		Clear();
		Resume();
	};
	scheduler->AddFrameTimer(timer);

	EventSystem::GetInstance()->UnRegisterKeyDownListener(this);
}
开发者ID:SZSilence06,项目名称:THXYY,代码行数:19,代码来源:PauseMenu.cpp

示例13: while

int LLBC_ThreadManager::ResumeAll()
{
    for (int i = 0; i < LLBC_CFG_THREAD_MAX_THREAD_NUM; i++)
    {
        LLBC_ThreadDescriptor *threadDesc = _threads[i];
        while (threadDesc)
        {
            LLBC_ThreadDescriptor *tmpThreadDesc = threadDesc;
            threadDesc = threadDesc->GetThreadNext();

            if (Resume(tmpThreadDesc->GetHandle()) != LLBC_OK)
            {
                return LLBC_FAILED;
            }
        }
    }

    return LLBC_OK;
}
开发者ID:lailongwei,项目名称:llbc,代码行数:19,代码来源:ThreadManager.cpp

示例14: GetPreferredSound

    bool CCE3SoundWrapper::IsPlaying()
    {
        if ( IsActive() )
        {
            // Returns true if at least one sound is playing
            ISound* sound = GetPreferredSound();

            bool bPlaying = IsSoundPlaying( sound );

            if ( !bPlaying && !m_bPaused && !m_sSoundOrEvent.empty() )
            {
                Resume(); // restore consistency
            }

            return IsSoundPlaying( sound );
        }

        return false;
    }
开发者ID:Aboutdept,项目名称:Plugin_Videoplayer,代码行数:19,代码来源:CCE3SoundWrapper.cpp

示例15: defined

void CMyControl::Poll()
{
	super::Poll();

#if defined(HOLD_PIN) && defined(RESUME_PIN)

	if (IsHold())
	{
		if (_resume.IsOn())
		{
			Resume();
		}
	} 
	else if (_hold.IsOn())
	{
		Hold();
	}
#endif
}
开发者ID:aiten,项目名称:CNCLib,代码行数:19,代码来源:MyControl.cpp


注:本文中的Resume函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。