|
LLDB mainline
|
Per-thread policy stack. More...
#include <Policy.h>
Classes | |
| class | Guard |
| RAII guard that pushes a policy on construction and pops on destruction. More... | |
Public Member Functions | |
| Policy | Current () const |
| void | Push (Policy policy) |
| void | Pop () |
| void | Dump (Stream &s) const |
Static Public Member Functions | |
| static PolicyStack & | Get () |
Private Attributes | |
| llvm::SmallVector< Policy > | m_stack = {Policy{}} |
Per-thread policy stack.
The stack lives in thread_local storage. Each thread has its own stack, initialized with a default-constructed base entry that is never popped. RAII guards (Guard) push and pop policies.
For thread pool workers that don't inherit thread_local storage, the policy must be passed into the lambda and pushed onto the worker thread's stack when the task starts.
| Policy PolicyStack::Current | ( | ) | const |
Definition at line 17 of file Policy.cpp.
References lldb_private::Policy::Dump(), lldb_private::StreamString::GetData(), lldb_private::GetLog(), LLDB_LOG, m_stack, and lldb_private::Process.
Referenced by lldb_private::Target::GetAPIMutex(), lldb_private::Process::PrivateStateThread::GetRunLock(), lldb_private::Thread::GetStackFrameList(), lldb_private::Process::GetState(), lldb_private::StopInfoBreakpoint::PerformAction(), lldb_private::StopInfoWatchpoint::PerformAction(), and lldb_private::StackFrameList::SelectMostRelevantFrame().
| void PolicyStack::Dump | ( | Stream & | s | ) | const |
Definition at line 39 of file Policy.cpp.
References m_stack, and lldb_private::Stream::Printf().
|
inlinestatic |
Definition at line 87 of file Policy.h.
Referenced by lldb_private::Target::GetAPIMutex(), lldb_private::Process::PrivateStateThread::GetRunLock(), lldb_private::Thread::GetStackFrameList(), lldb_private::Process::GetState(), lldb_private::PolicyStack::Guard::Guard(), lldb_private::StopInfoBreakpoint::PerformAction(), lldb_private::StopInfoWatchpoint::PerformAction(), lldb_private::StackFrameList::SelectMostRelevantFrame(), and lldb_private::PolicyStack::Guard::~Guard().
|
inline |
Definition at line 96 of file Policy.h.
References m_stack.
Referenced by lldb_private::PolicyStack::Guard::~Guard().
|
inline |
Definition at line 94 of file Policy.h.
References m_stack.
Referenced by lldb_private::PolicyStack::Guard::Guard().