[lldb] Initialize Python exactly once
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 19 Jan 2022 17:16:16 +0000 (09:16 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 19 Jan 2022 17:56:55 +0000 (09:56 -0800)
commiteb5c0ea681803361a1944c966f4becaa9e22dc1a
tree1dab18243e015d5db2e96efb7539c0e1ccd28a6b
parent85c2bd2a0e0e2c1706bbf50203d5bbbeedbbd741
[lldb] Initialize Python exactly once

We got a few crash reports that showed LLDB initializing Python on two
separate threads. Make sure Python is initialized exactly once.

rdar://87287005

Differential revision: https://reviews.llvm.org/D117601
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp