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


C++ Thread::GetHandle方法代码示例

本文整理汇总了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();
}
开发者ID:IwishIcanFLighT,项目名称:Asylum_Tutorials,代码行数:32,代码来源:main.cpp

示例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();
}
开发者ID:Stretto,项目名称:mago,代码行数:25,代码来源:EventCallbackBase.cpp

示例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());
        }
    }
}
开发者ID:Aurorer,项目名称:citra,代码行数:19,代码来源:thread.cpp

示例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));
  }
}
开发者ID:geota,项目名称:hadesmem,代码行数:10,代码来源:thread_helpers.hpp

示例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;
}
开发者ID:geota,项目名称:hadesmem,代码行数:16,代码来源:thread_helpers.hpp

示例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;
}
开发者ID:geota,项目名称:hadesmem,代码行数:21,代码来源:thread_helpers.hpp


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