python 锁 装饰器

锁 装饰器

from threading import Lock

signal_lock = Lock()

def send_signal_lock(func):
    def inner(*args,**kwargs):
        signal_lock.acquire()
        res = func(*args,**kwargs)
        signal_lock.release()
        return res
    return inner
上一篇:Gin源码解析


下一篇:Python接口自动化之requests请求封装