Замок в питоне
import threading
lock = threading.Lock()
lock.acquire()
# Your code here
lock.release()
Happy Friend
import threading
lock = threading.Lock()
lock.acquire()
# Your code here
lock.release()