Answers for "how to lock writing to a variable thread python"

1

how to lock writing to a variable thread python

from threading import Lock, Thread
lock = Lock()
g = 0
lock.acquire()
g += 1
lock.release()
Posted by: Guest on March-09-2020

Code answers related to "how to lock writing to a variable thread python"

Python Answers by Framework

Browse Popular Code Answers by Language