本文整理汇总了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;
}
}
示例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
}
示例3: GetThread
bool LcdComBase::IsRunning(){
wxThread *t = GetThread();
if( t ){
if( t->IsRunning() ){
return true;
}
else {
return false;
}
}
return false;
}
示例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();
}
示例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);
}
示例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;
}
示例7: GetThread
/*
================
idThread::ObjectMoveDone
================
*/
void idThread::ObjectMoveDone( int threadnum, idEntity *obj )
{
idThread *thread;
if ( !threadnum )
{
return;
}
thread = GetThread( threadnum );
if ( thread )
{
thread->ObjectMoveDone( obj );
}
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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();
}
示例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());
}
}
示例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;
}
示例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;
}