本文整理汇总了C++中ThreadContext::GetThreadId方法的典型用法代码示例。如果您正苦于以下问题:C++ ThreadContext::GetThreadId方法的具体用法?C++ ThreadContext::GetThreadId怎么用?C++ ThreadContext::GetThreadId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThreadContext
的用法示例。
在下文中一共展示了ThreadContext::GetThreadId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ThreadContext
ThreadContext& DebugThreadManager::StartThread(const Common::StackPreparator& stack, size_t stackSize, const PEF::TransitionVector& entryPoint, bool startNow)
{
// lldb enforces some alignment constraints on the stack, so align it correctly by allocating some additional memory
ThreadContext* context = new ThreadContext(allocator, nextId, stackSize + 0x200);
uint32_t stackAddress = allocator.ToIntPtr(*context->stack);
stackAddress += 0x200;
stackAddress &= ~0x1ff;
auto info = stack.WriteStack(allocator.ToPointer<char>(stackAddress), stackAddress, stackSize);
context->machineState.r1 = allocator.ToIntPtr(info.sp);
context->machineState.r2 = entryPoint.TableOfContents;
context->machineState.r3 = context->machineState.r27 = info.argc;
context->machineState.r4 = context->machineState.r28 = allocator.ToIntPtr(info.argv);
context->machineState.r5 = context->machineState.r29 = allocator.ToIntPtr(info.envp);
context->machineState.lr = allocator.ToIntPtr(context->interpreter.GetEndAddress());
context->pc = entryPoint.EntryPoint;
context->thread = std::thread(&DebugThreadManager::DebugLoop, this, std::ref(*context), startNow);
// this should stay at the end of the method or be scoped
std::lock_guard<std::mutex> lock(threadsLock);
threads[context->GetThreadId()].reset(context);
nextId += 0x10;
return *context;
}