gevent.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:easypy 作者: weka-io 项目源码 文件源码
def _unpatch_logging_handlers_lock():
    # we dont want to use logger locks since those are used by both real thread and gevent greenlets
    # switching from one to the other will cause gevent hub to throw an exception
    import logging

    RLock = gevent.monkey.saved['threading']['_CRLock']

    for handler in logging._handlers.values():
        if handler.lock:
            handler.lock = RLock()

    def create_unpatched_lock_for_handler(handler):
        handler.lock = RLock()

    # patch future handlers
    logging.Handler.createLock = create_unpatched_lock_for_handler
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号