本文整理汇总了C++中Thread::GetHandle方法的典型用法代码示例。如果您正苦于以下问题:C++ Thread::GetHandle方法的具体用法?C++ Thread::GetHandle怎么用?C++ Thread::GetHandle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thread
的用法示例。
在下文中一共展示了Thread::GetHandle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UninitScene
//*************************************************************************************************************
void UninitScene()
{
streamer.Destroy();
WaitForSingleObject(worker.GetHandle(), 3000);
worker.Close();
if( masteringvoice )
masteringvoice->DestroyVoice();
if( xaudio2 )
xaudio2->Release();
// don't do this, ever!!!
system1.~ParticleSystem();
for( int i = 0; i < NUM_DWARFS; ++i )
dwarfs[i].~AnimatedMesh();
SAFE_RELEASE(skyeffect);
SAFE_RELEASE(skymesh);
SAFE_RELEASE(skytex);
SAFE_RELEASE(text);
SAFE_RELEASE(mesh);
SAFE_RELEASE(effect);
SAFE_RELEASE(texture1);
SAFE_RELEASE(texture2);
DXKillAnyRogueObject();
//CoUninitialize();
}
示例2: while
void EventCallbackBase::PrintCallstacksX64( IProcess* process )
{
Enumerator<Thread*>* threads = NULL;
process->EnumThreads( threads );
while ( threads->MoveNext() )
{
Thread* t = threads->GetCurrent();
std::list<FrameX64> stack;
ReadCallstackX64( process->GetHandle(), t->GetHandle(), stack );
printf( " TID=%d\n", t->GetId() );
for ( std::list<FrameX64>::iterator it = stack.begin();
it != stack.end();
it++ )
{
printf( " RIP=%016x, RBP=%016x\n", it->Rip, it->Rbp );
}
}
threads->Release();
}
示例3: Reschedule
/// Reschedules to the next available thread (call after current thread is suspended)
void Reschedule() {
Thread* prev = GetCurrentThread();
Thread* next = NextThread();
HLE::g_reschedule = false;
if (next > 0) {
INFO_LOG(KERNEL, "context switch 0x%08X -> 0x%08X", prev->GetHandle(), next->GetHandle());
SwitchContext(next);
// Hack - There is no mechanism yet to waken the primary thread if it has been put to sleep
// by a simulated VBLANK thread switch. So, we'll just immediately set it to "ready" again.
// This results in the current thread yielding on a VBLANK once, and then it will be
// immediately placed back in the queue for execution.
if (prev->wait_type == WAITTYPE_VBLANK) {
ResumeThreadFromWait(prev->GetHandle());
}
}
}
示例4: SetThreadContext
inline void SetThreadContext(Thread const& thread, CONTEXT const& context)
{
if (!::SetThreadContext(thread.GetHandle(), &context))
{
DWORD const last_error = ::GetLastError();
HADESMEM_DETAIL_THROW_EXCEPTION(Error()
<< ErrorString("SetThreadContext failed.")
<< ErrorCodeWinLast(last_error));
}
}
示例5: ResumeThread
inline DWORD ResumeThread(Thread const& thread)
{
HADESMEM_DETAIL_TRACE_FORMAT_A("Resuming thread with ID 0n%lu.",
thread.GetId());
DWORD const suspend_count = ::ResumeThread(thread.GetHandle());
if (suspend_count == static_cast<DWORD>(-1))
{
DWORD const last_error = ::GetLastError();
HADESMEM_DETAIL_THROW_EXCEPTION(Error()
<< ErrorString("ResumeThread failed.")
<< ErrorCodeWinLast(last_error));
}
return suspend_count;
}
示例6: GetThreadContext
inline CONTEXT GetThreadContext(Thread const& thread, DWORD context_flags)
{
if (::GetCurrentThreadId() == thread.GetId() &&
context_flags != CONTEXT_DEBUG_REGISTERS)
{
HADESMEM_DETAIL_THROW_EXCEPTION(
Error() << ErrorString("GetThreadContext called for current thread."));
}
CONTEXT context{};
context.ContextFlags = context_flags;
if (!::GetThreadContext(thread.GetHandle(), &context))
{
DWORD const last_error = ::GetLastError();
HADESMEM_DETAIL_THROW_EXCEPTION(Error()
<< ErrorString("GetThreadContext failed.")
<< ErrorCodeWinLast(last_error));
}
return context;
}