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


C++ GetThread函数代码示例

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


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

示例1: GetThread

/*
================
idThread::Event_WaitForThread
================
*/
void idThread::Event_WaitForThread( int num ) {
	idThread *thread;

	thread = GetThread( num );
	if ( !thread ) {
		if ( g_debugScript.GetBool() ) {
			// just print a warning and continue executing
			Warning( "Thread %d not running", num );
		}
	} else {
		Pause();
		waitingForThread = thread;
	}
}
开发者ID:Salamek,项目名称:Shadow-of-Dust,代码行数:19,代码来源:Script_Thread.cpp

示例2: CRemotingServices__CheckForContextMatch

//+----------------------------------------------------------------------------
//
//  Method:     CRemotingServices::CheckForContextMatch   public
//
//  Synopsis:   This code generates a check to see if the current context and
//              the context of the proxy match.
// 
//+----------------------------------------------------------------------------
//
// returns zero if contexts match
// returns non-zero if contexts don't match
//
extern "C" UINT_PTR __stdcall CRemotingServices__CheckForContextMatch(Object* pStubData)
{
    // This method cannot have a contract because CreateStubForNonVirtualMethod assumes 
    // it won't trash XMM registers. The code generated for contracts by recent compilers
    // is trashing XMM registers.
    STATIC_CONTRACT_NOTHROW;
    STATIC_CONTRACT_GC_NOTRIGGER;
    STATIC_CONTRACT_MODE_COOPERATIVE; // due to the Object parameter
    STATIC_CONTRACT_SO_TOLERANT;

    UINT_PTR contextID  = *(UINT_PTR*)pStubData->UnBox();
    UINT_PTR contextCur = (UINT_PTR)GetThread()->m_Context;
    return (contextCur != contextID);   // chosen to match x86 convention
}
开发者ID:0-wiz-0,项目名称:coreclr,代码行数:26,代码来源:remotingamd64.cpp

示例3: GetThread

bool LcdComBase::IsRunning(){
	
	 wxThread *t = GetThread();
    if( t ){
        if( t->IsRunning() ){
        	 return true;
        }
        else {
        	return false;
        }
    }

    return false;
}
开发者ID:BackupTheBerlios,项目名称:wxsmps-svn,代码行数:14,代码来源:lcdcom.cpp

示例4: recursion_guard

void dlgMain::OnRefreshAll(wxCommandEvent &event)
{
    // prevent reentrancy
    static wxRecursionGuardFlag s_rgf;
    wxRecursionGuard recursion_guard(s_rgf);
    
    if (recursion_guard.IsInside())
        return;	

    if (GetThread() && GetThread()->IsRunning())
        return;

    if (!MServer->GetServerCount())
        return;
        
    m_LstCtrlServers->DeleteAllItems();
    m_LstCtrlPlayers->DeleteAllItems();
    
    QueriedServers = 0;
    TotalPlayers = 0;
    
    mtcs_Request.Signal = mtcs_getservers;
    mtcs_Request.ServerListIndex = -1;
    mtcs_Request.Index = -1;

    // Create monitor thread and run it
    if (this->wxThreadHelper::Create() != wxTHREAD_NO_ERROR)
    {
        wxMessageBox(_T("Could not create monitor thread!"), 
                     _T("Error"), 
                     wxOK | wxICON_ERROR);
                     
        wxExit();
    }

    GetThread()->Run();   
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:37,代码来源:dlg_main.cpp

示例5: Flash

void wxGISMapView::StartFlashing(wxGISEnumFlashStyle eFlashStyle)
{
    m_eFlashStyle = eFlashStyle;

    Flash(eFlashStyle);

    Refresh();

    //wait drawings end to flash
    if (GetThread() && GetThread()->IsRunning())
    {
        GetThread()->Wait();
    }

    int nMilliSec = DEFAULT_FLASH_PERIOD;
    switch(eFlashStyle)
    {
    case enumGISMapFlashWaves:
        nMilliSec /= 2;
        {
        wxGISAppConfig oConfig = GetConfig();
        if(oConfig.IsOk())
            nMilliSec = oConfig.ReadInt(enumGISHKCU, wxString(wxT("wxGISCommon/map/flash_waves_time")), nMilliSec);
        }
        break;
    default:
    case enumGISMapFlashNewColor:
        {
        wxGISAppConfig oConfig = GetConfig();
        if(oConfig.IsOk())
            nMilliSec = oConfig.ReadInt(enumGISHKCU, wxString(wxT("wxGISCommon/map/flash_newcolor_time")), nMilliSec);
        }
        break;
    };
    m_nDrawingState = enumGISMapFlashing;
    m_timer.Start(nMilliSec);
}
开发者ID:Mileslee,项目名称:wxgis,代码行数:37,代码来源:mapview.cpp

示例6: piwait

int piwait(int tid){
	Initialize();
	
	TCB_t* waitedThread;

	//TRY TO GET THREAD TO BE WAITED FOR FROM
	//THREAD LISTS
	waitedThread = GetThread(activeThreads, tid);
	
	if(!waitedThread){
		waitedThread = GetThread(expiredThreads, tid);
	
		if(!waitedThread){
			waitedThread = GetThread(blockedThreads, tid);
			if(!waitedThread){
				waitedThread = GetThread(mutexBlockedThreads, tid);
			}
		}
	}

	//IF FOUND THE SPECIFIED TID IN THREAD LISTS
	if(waitedThread){
		
		//THE SPECIFIED TID CAN'T BE WAITED FOR
		//ANOTHER THREAD
		if(!GetWait(waitTids, tid)){
			waitTids = AddWait(waitTids, tid, runningThread->tid);

			runningThread->state = BLOCKED;
		
			swapcontext(&runningThread->context, schedulerCtx);
			return 0;
		}
	}

	return -1;
}
开发者ID:khinbaptista,项目名称:pithread,代码行数:37,代码来源:pithread.c

示例7: GetThread

/*
================
idThread::ObjectMoveDone
================
*/
void idThread::ObjectMoveDone( int threadnum, idEntity *obj )
{
    idThread *thread;

    if ( !threadnum )
    {
        return;
    }

    thread = GetThread( threadnum );
    if ( thread )
    {
        thread->ObjectMoveDone( obj );
    }
}
开发者ID:revelator,项目名称:Revelator-Doom3,代码行数:20,代码来源:Script_Thread.cpp

示例8: while

wxThread::ExitCode Timer::Entry()
{
    // here we do our long task, periodically calling TestDestroy():
    while (_running && !GetThread()->TestDestroy())
    {
        wxMilliSleep(_ms);
        if (_running)
        {
            wxQueueEvent(_parent->GetEventHandler(), new wxCommandEvent(UpdateEvent)); //new wxTimerEvent());
        }
    }
    // TestDestroy() returned true (which means the main thread asked us
    // to terminate as soon as possible) or we ended the long task...
    return (wxThread::ExitCode)0;
}
开发者ID:JochenKempfle,项目名称:MoCap,代码行数:15,代码来源:Timer.cpp

示例9: wxMessageBox

// Posts a message from the main thread to the monitor thread
bool dlgMain::MainThrPostEvent(mtcs_t CommandSignal, wxInt32 Index, 
    wxInt32 ListIndex)
{
    if (GetThread() && GetThread()->IsRunning())
        return false;

    // Create monitor thread
    if (this->wxThreadHelper::Create() != wxTHREAD_NO_ERROR)
    {
        wxMessageBox(_T("Could not create monitor thread!"), 
                     _T("Error"), 
                     wxOK | wxICON_ERROR);
                     
        wxExit();
    }
    
	mtcs_Request.Signal = CommandSignal;
    mtcs_Request.Index = Index;
    mtcs_Request.ServerListIndex = ListIndex;

    GetThread()->Run();
    
    return true;
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:25,代码来源:dlg_main.cpp

示例10: GetThread

void CrstBase::PostEnter()
{
    if (g_pThreadStore->IsCrstForThreadStore(this))
        return;
    
    Thread* pThread = GetThread();
    if (pThread)
    {
        if (!m_heldInSuspension)
            m_ulReadyForSuspensionCount =
                pThread->GetReadyForSuspensionCount();
        if (!m_enterInCoopGCMode)
            m_enterInCoopGCMode = pThread->PreemptiveGCDisabled();
    }
}
开发者ID:ArildF,项目名称:masters,代码行数:15,代码来源:crst.cpp

示例11: wxLogError

bool wxGxDiscConnectionUI::CreateAndRunCheckThread(void)
{
    if (CreateThread(wxTHREAD_JOINABLE) != wxTHREAD_NO_ERROR)
    {
        wxLogError(_("Could not create the thread!"));
        return false;
    }

    if (GetThread()->Run() != wxTHREAD_NO_ERROR)
    {
        wxLogError(_("Could not run the thread!"));
        return false;
    }
    return true;
}
开发者ID:GimpoByte,项目名称:nextgismanager,代码行数:15,代码来源:gxdiscconnectionui.cpp

示例12: FCIMPL4

FCIMPLEND
#endif // !FEATURE_CORECLR

FCIMPL4(void, AssemblyNameNative::Init, Object * refThisUNSAFE, OBJECTREF * pAssemblyRef, CLR_BOOL fForIntrospection, CLR_BOOL fRaiseResolveEvent)
{
    FCALL_CONTRACT;

    ASSEMBLYNAMEREF pThis = (ASSEMBLYNAMEREF) (OBJECTREF) refThisUNSAFE;
    HRESULT hr = S_OK;
    
    HELPER_METHOD_FRAME_BEGIN_1(pThis);
    
    *pAssemblyRef = NULL;

    if (pThis == NULL)
        COMPlusThrow(kNullReferenceException, W("NullReference_This"));

    Thread * pThread = GetThread();

    CheckPointHolder cph(pThread->m_MarshalAlloc.GetCheckpoint()); //hold checkpoint for autorelease

    AssemblySpec spec;
    hr = spec.InitializeSpec(&(pThread->m_MarshalAlloc), (ASSEMBLYNAMEREF *) &pThis, TRUE, FALSE); 

    if (SUCCEEDED(hr))
    {
        spec.AssemblyNameInit(&pThis,NULL);
    }
    else if ((hr == FUSION_E_INVALID_NAME) && fRaiseResolveEvent)
    {
        Assembly * pAssembly = GetAppDomain()->RaiseAssemblyResolveEvent(&spec, fForIntrospection, FALSE);

        if (pAssembly == NULL)
        {
            EEFileLoadException::Throw(&spec, hr);
        }
        else
        {
            *((OBJECTREF *) (&(*pAssemblyRef))) = pAssembly->GetExposedObject();
        }
    }
    else
    {
        ThrowHR(hr);
    }
    
    HELPER_METHOD_FRAME_END();
}
开发者ID:Arpit007,项目名称:coreclr,代码行数:48,代码来源:assemblyname.cpp

示例13: GetThread

void SpinLock::dbg_EnterLock()
{
    Thread  *pThread = GetThread();
	if (pThread)
	{
        if (!m_heldInSuspension)
            m_ulReadyForSuspensionCount =
                pThread->GetReadyForSuspensionCount();
        if (!m_enterInCoopGCMode)
            m_enterInCoopGCMode = (pThread->PreemptiveGCDisabled() == TRUE);
	}
	else
	{
		_ASSERTE(g_fProcessDetach == TRUE || dbgOnly_IsSpecialEEThread());
	}
}
开发者ID:ArildF,项目名称:masters,代码行数:16,代码来源:spinlock.cpp

示例14: clsLogAutoPtr

JEventBody* JThreadManager::MakeEventBody(JCHAR* pThrdName, JCHAR* pModName, JEVT_TYPE eType)
{
    JThread* pThread = JNULL;
	JEventBody* pEventBody = JNULL;

    JLogAutoPtr clsLogAutoPtr(JSingleton<JLog>::instance(), 
        JLOG_MOD_THREAD, "JThreadManager::MakeEventBody");

    pThread = GetThread(pThrdName);
    if (pThread)
    {
        pEventBody = pThread->MakeEventBody(eType, pModName);
    }

	return pEventBody;
}
开发者ID:gothame,项目名称:jphone,代码行数:16,代码来源:JThread.cpp

示例15: wxLogError

bool wxGISProcess::CreateAndRunReadThread(void)
{
    if (CreateThread(wxTHREAD_JOINABLE) != wxTHREAD_NO_ERROR)//wxTHREAD_DETACHED//
    {
        wxLogError(_("Could not create the thread!"));
        return false;
    }

    // go!
    if (GetThread()->Run() != wxTHREAD_NO_ERROR)
    {
        wxLogError(_("Could not run the thread!"));
        return false;
    }
    return true;
}
开发者ID:Mileslee,项目名称:wxgis,代码行数:16,代码来源:process.cpp


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