我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用_thread._local()。
def main_thread(): """Return the main thread object. In normal conditions, the main thread is the thread from which the Python interpreter was started. """ return _main_thread # get thread-local implementation, either from the thread # module, or from the python fallback