• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetThread函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: wxLogError

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

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


示例17: wxLogError

bool wxGxContentView::CreateAndRunFillMetaThread(void)
{
    if (CreateThread(wxTHREAD_DETACHED) != 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,代码行数:16,代码来源:gxcontentview.cpp


示例18: while

/*
================
idThread::Init
================
*/
void idThread::Init( void ) {
	// create a unique threadNum
	do {
		threadIndex++;
		if( threadIndex == 0 ) {
			threadIndex = 1;
		}
	} while( GetThread( threadIndex ) );
	threadNum = threadIndex;
	threadList.Append( this );
	creationTime = gameLocal.time;
	lastExecuteTime = 0;
	manualControl = false;
	ClearWaitFor();
	interpreter.SetThread( this );
}
开发者ID:nbohr1more,项目名称:Revelation,代码行数:21,代码来源:Script_Thread.cpp


示例19: GetPackets2

void PacketManager :: GetPackets2(void)
{
	if(mQueueData.size() == 0)
		return;

#ifdef DEBUG_TIME
	Debug::TimeTrack("GetPackets2", 50);
#endif

	GetThread("PacketManager::GetPackets2");
	mTransition.assign(mQueueData.begin(), mQueueData.end());
	mQueueData.clear();
	ReleaseThread();

	//Sort the transition list into the outgoing Send list according to socket.
	//Try to cluster the packets if possible.
	std::list<PendingSocket>::iterator it;
	std::list<Packet>::iterator pit;
	for(it = mTransition.begin(); it != mTransition.end(); ++it)
	{
		PendingSocket *pSock = GetSendSocket(it->mSocket);
		if(pSock != NULL)
		{
			for(pit = it->mPacketList.begin(); pit != it->mPacketList.end(); ++pit)
			{
				int r = pSock->AddData(*pit);
				if(r == PendingSocket::DATA_ELEMENT_APPEND)
				{
					mClusterPackets++;
					mClusterPacketBytes += pit->mData.size();
				}
			}
		}
	}

	//All sorted, wipe the transition buffer.
	mTransition.clear();

	/*
	if(mSendData.size() == 0)
		mSendData.assign(mQueueData.begin(), mQueueData.end());
	else
		mSendData.insert(mSendData.end(), mQueueData.begin(), mQueueData.end());
	mQueueData.clear();
	ReleaseThread();
	*/
}
开发者ID:Wuffie12,项目名称:iceee,代码行数:47,代码来源:Packet.cpp


示例20: GetThread

bool
ThreadInfo::CanInvokeJS() const
{
#ifdef SPS_STANDALONE
  return false;
#else
  nsIThread* thread = GetThread();
  if (!thread) {
    MOZ_ASSERT(IsMainThread());
    return true;
  }
  bool result;
  mozilla::DebugOnly<nsresult> rv = thread->GetCanInvokeJS(&result);
  MOZ_ASSERT(NS_SUCCEEDED(rv));
  return result;
#endif
}
开发者ID:nwgh,项目名称:gecko-dev,代码行数:17,代码来源:ThreadInfo.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetThreadContext函数代码示例发布时间:2022-05-30
下一篇:
C++ GetTextPeer函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap