forked from OSchip/llvm-project
Fix a deadlock in the Python interpreter vrs. SIGINT.
The interpreter gets invoked in the sigint handler to cancel long-running Python operations. That requires the interpreter lock, but that may be held by the Python operation that's getting interrupted, so the mutex needs to be recursive. <rdar://problem/33179086> llvm-svn: 307942
This commit is contained in:
parent
28a4d0b981
commit
30bac79162
|
@ -539,7 +539,7 @@ private:
|
|||
std::string m_repeat_command; // Stores the command that will be executed for
|
||||
// an empty command string.
|
||||
lldb::ScriptInterpreterSP m_script_interpreter_sp;
|
||||
std::mutex m_script_interpreter_mutex;
|
||||
std::recursive_mutex m_script_interpreter_mutex;
|
||||
lldb::IOHandlerSP m_command_io_handler_sp;
|
||||
char m_comment_char;
|
||||
bool m_batch_command_mode;
|
||||
|
|
|
@ -2475,7 +2475,7 @@ void CommandInterpreter::HandleCommandsFromFile(
|
|||
}
|
||||
|
||||
ScriptInterpreter *CommandInterpreter::GetScriptInterpreter(bool can_create) {
|
||||
std::lock_guard<std::mutex> locker(m_script_interpreter_mutex);
|
||||
std::lock_guard<std::recursive_mutex> locker(m_script_interpreter_mutex);
|
||||
if (!m_script_interpreter_sp) {
|
||||
if (!can_create)
|
||||
return nullptr;
|
||||
|
|
Loading…
Reference in New Issue