Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. def synchronized(func):
  2.  
  3.         func.__lock__ = threading.Lock()
  4.  
  5.         def synced_func(*args, **kws):
  6.                 with func.__lock__:
  7.                         return func(*args, **kws)
  8.  
  9.         return synced_func
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement