diff options
author | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
---|---|---|
committer | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
commit | b9c1b51e45b845debb76d8658edabca70ca56079 (patch) | |
tree | dfcb5a13ef2b014202340f47036da383eaee74aa /lldb/tools/lldb-mi/MICmnThreadMgrStd.cpp | |
parent | d5aa73376966339caad04013510626ec2e42c760 (diff) | |
download | bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip |
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has
*** two obvious implications:
Firstly, merging this particular commit into a downstream fork may be a huge
effort. Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit. The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):
find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;
The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.
Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit. There are alternatives available that will attempt
to look through this change and find the appropriate prior commit. YMMV.
llvm-svn: 280751
Diffstat (limited to 'lldb/tools/lldb-mi/MICmnThreadMgrStd.cpp')
-rw-r--r-- | lldb/tools/lldb-mi/MICmnThreadMgrStd.cpp | 149 |
1 files changed, 71 insertions, 78 deletions
diff --git a/lldb/tools/lldb-mi/MICmnThreadMgrStd.cpp b/lldb/tools/lldb-mi/MICmnThreadMgrStd.cpp index ec223b802f8..efa24d60250 100644 --- a/lldb/tools/lldb-mi/MICmnThreadMgrStd.cpp +++ b/lldb/tools/lldb-mi/MICmnThreadMgrStd.cpp @@ -13,30 +13,28 @@ #include "MICmnResources.h" #include "MIUtilSingletonHelper.h" -//++ ------------------------------------------------------------------------------------ +//++ +//------------------------------------------------------------------------------------ // Details: CMICmnThreadMgr constructor. // Type: Method. // Args: None. // Return: None. // Throws: None. //-- -CMICmnThreadMgrStd::CMICmnThreadMgrStd() -{ -} +CMICmnThreadMgrStd::CMICmnThreadMgrStd() {} -//++ ------------------------------------------------------------------------------------ +//++ +//------------------------------------------------------------------------------------ // Details: CMICmnThreadMgr destructor. // Type: Method. // Args: None. // Return: None. // Throws: None. //-- -CMICmnThreadMgrStd::~CMICmnThreadMgrStd() -{ - Shutdown(); -} +CMICmnThreadMgrStd::~CMICmnThreadMgrStd() { Shutdown(); } -//++ ------------------------------------------------------------------------------------ +//++ +//------------------------------------------------------------------------------------ // Details: Initialise resources for *this thread manager. // Type: Method. // Args: None. @@ -44,36 +42,36 @@ CMICmnThreadMgrStd::~CMICmnThreadMgrStd() // MIstatus::failure - Functional failed. // Throws: None. //-- -bool -CMICmnThreadMgrStd::Initialize() -{ - m_clientUsageRefCnt++; +bool CMICmnThreadMgrStd::Initialize() { + m_clientUsageRefCnt++; - if (m_bInitialized) - return MIstatus::success; + if (m_bInitialized) + return MIstatus::success; - bool bOk = MIstatus::success; + bool bOk = MIstatus::success; - ClrErrorDescription(); - CMIUtilString errMsg; + ClrErrorDescription(); + CMIUtilString errMsg; - // Note initialisation order is important here as some resources depend on previous - MI::ModuleInit<CMICmnLog>(IDS_MI_INIT_ERR_LOG, bOk, errMsg); - MI::ModuleInit<CMICmnResources>(IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg); + // Note initialisation order is important here as some resources depend on + // previous + MI::ModuleInit<CMICmnLog>(IDS_MI_INIT_ERR_LOG, bOk, errMsg); + MI::ModuleInit<CMICmnResources>(IDS_MI_INIT_ERR_RESOURCES, bOk, errMsg); - m_bInitialized = bOk; + m_bInitialized = bOk; - if (!bOk) - { - CMIUtilString strInitError(CMIUtilString::Format(MIRSRC(IDS_MI_INIT_ERR_THREADMGR), errMsg.c_str())); - SetErrorDescription(strInitError); - return MIstatus::failure; - } + if (!bOk) { + CMIUtilString strInitError(CMIUtilString::Format( + MIRSRC(IDS_MI_INIT_ERR_THREADMGR), errMsg.c_str())); + SetErrorDescription(strInitError); + return MIstatus::failure; + } - return bOk; + return bOk; } -//++ ------------------------------------------------------------------------------------ +//++ +//------------------------------------------------------------------------------------ // Details: Release resources for *this thread manager. // Type: Method. // Args: None. @@ -81,68 +79,65 @@ CMICmnThreadMgrStd::Initialize() // MIstatus::failure - Functional failed. // Throws: None. //-- -bool -CMICmnThreadMgrStd::Shutdown() -{ - if (--m_clientUsageRefCnt > 0) - return MIstatus::success; +bool CMICmnThreadMgrStd::Shutdown() { + if (--m_clientUsageRefCnt > 0) + return MIstatus::success; - if (!m_bInitialized) - return MIstatus::success; + if (!m_bInitialized) + return MIstatus::success; - m_bInitialized = false; + m_bInitialized = false; - ClrErrorDescription(); + ClrErrorDescription(); - bool bOk = MIstatus::success; - CMIUtilString errMsg; + bool bOk = MIstatus::success; + CMIUtilString errMsg; - // Tidy up - ThreadAllTerminate(); + // Tidy up + ThreadAllTerminate(); - // Note shutdown order is important here - MI::ModuleShutdown<CMICmnResources>(IDE_MI_SHTDWN_ERR_RESOURCES, bOk, errMsg); - MI::ModuleShutdown<CMICmnLog>(IDS_MI_SHTDWN_ERR_LOG, bOk, errMsg); + // Note shutdown order is important here + MI::ModuleShutdown<CMICmnResources>(IDE_MI_SHTDWN_ERR_RESOURCES, bOk, errMsg); + MI::ModuleShutdown<CMICmnLog>(IDS_MI_SHTDWN_ERR_LOG, bOk, errMsg); - if (!bOk) - { - SetErrorDescriptionn(MIRSRC(IDS_MI_SHUTDOWN_ERR), errMsg.c_str()); - } + if (!bOk) { + SetErrorDescriptionn(MIRSRC(IDS_MI_SHUTDOWN_ERR), errMsg.c_str()); + } - return bOk; + return bOk; } -//++ ------------------------------------------------------------------------------------ -// Details: Ask the thread manager to kill all threads and wait until they have died +//++ +//------------------------------------------------------------------------------------ +// Details: Ask the thread manager to kill all threads and wait until they have +// died // Type: Method. // Args: None. // Return: MIstatus::success - Functional succeeded. // MIstatus::failure - Functional failed. // Throws: None. //-- -bool -CMICmnThreadMgrStd::ThreadAllTerminate() -{ - ThreadList_t::const_iterator it = m_threadList.begin(); - for (; it != m_threadList.end(); ++it) - { - // If the thread is still running - CMIUtilThreadActiveObjBase *pThread = *it; - if (pThread->ThreadIsActive()) - { - // Ask this thread to kill itself - pThread->ThreadKill(); - - // Wait for this thread to die - pThread->ThreadJoin(); - } +bool CMICmnThreadMgrStd::ThreadAllTerminate() { + ThreadList_t::const_iterator it = m_threadList.begin(); + for (; it != m_threadList.end(); ++it) { + // If the thread is still running + CMIUtilThreadActiveObjBase *pThread = *it; + if (pThread->ThreadIsActive()) { + // Ask this thread to kill itself + pThread->ThreadKill(); + + // Wait for this thread to die + pThread->ThreadJoin(); } + } - return MIstatus::success; + return MIstatus::success; } -//++ ------------------------------------------------------------------------------------ -// Details: Add a thread object to *this manager's list of thread objects. The list to +//++ +//------------------------------------------------------------------------------------ +// Details: Add a thread object to *this manager's list of thread objects. The +// list to // used to manage thread objects centrally. // Type: Method. // Args: vrObj - (R) A thread object. @@ -150,10 +145,8 @@ CMICmnThreadMgrStd::ThreadAllTerminate() // MIstatus::failure - Functional failed. // Throws: None. //-- -bool -CMICmnThreadMgrStd::AddThread(const CMIUtilThreadActiveObjBase &vrObj) -{ - m_threadList.push_back(const_cast<CMIUtilThreadActiveObjBase *>(&vrObj)); +bool CMICmnThreadMgrStd::AddThread(const CMIUtilThreadActiveObjBase &vrObj) { + m_threadList.push_back(const_cast<CMIUtilThreadActiveObjBase *>(&vrObj)); - return MIstatus::success; + return MIstatus::success; } |