Python _thread 模块,_local() 实例源码

我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用_thread._local()

项目:ouroboros    作者:pybee    | 项目源码 | 文件源码
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
项目:kbe_server    作者:xiaohaoppy    | 项目源码 | 文件源码
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