Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def synchronized(func):
- func.__lock__ = threading.Lock()
- def synced_func(*args, **kws):
- with func.__lock__:
- return func(*args, **kws)
- return synced_func
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement