Как заблокировать запись на переменную поток Python
from threading import Lock, Thread
lock = Lock()
g = 0
lock.acquire()
g += 1
lock.release()
Curious Cod
from threading import Lock, Thread
lock = Lock()
g = 0
lock.acquire()
g += 1
lock.release()