From: Hafiz Abid Qadeer Date: Wed, 4 Feb 2015 09:59:23 +0000 (+0000) Subject: Fix a race condition in lldb-mi. X-Git-Tag: llvmorg-3.7.0-rc1~13106 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1f606ff0f6b73df512a4526763f8e3cfebbc690;p=platform%2Fupstream%2Fllvm.git Fix a race condition in lldb-mi. lldb-mi has 3 threads. 1. One that waits for user intput. 2. Another waits for 1st thread to get input command. 3. Waits for events from lldb. 2 & 3 needs to be synchronized so that they don't end up doing things at same time. For example, while "break insert" is processing, we can get a breakpoint event. Depending on where we are in "break-insert", it can have different behavior. In some cases, it can cause breakpoint to be deleted too. I have added a mutex so that command processing and event processing are done exclusively and they are not running at the same time. In longer term, I think thread 2 & 3 should be merged to be only one thread which can wait on command or events. Reviewed in http://reviews.llvm.org/D7371. llvm-svn: 228128 --- diff --git a/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.h b/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.h index be5904a..f4cefef 100644 --- a/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.h +++ b/lldb/tools/lldb-mi/MICmnLLDBDebugSessionInfo.h @@ -35,6 +35,7 @@ #include "MICmnLLDBDebugSessionInfoVarObj.h" #include "MICmnMIValueTuple.h" #include "MIUtilMapIdToVariant.h" +#include "MIUtilThreadBaseStd.h" // Declarations: class CMICmnLLDBDebugger; @@ -156,6 +157,7 @@ class CMICmnLLDBDebugSessionInfo : public CMICmnBase, public MI::ISingleton