Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to lock writing to a variable thread python

from threading import Lock, Thread
lock = Lock()
g = 0
lock.acquire()
g += 1
lock.release()
Source by hackernoon.com #
 
PREVIOUS NEXT
Tagged: #lock #writing #variable #thread #python
ADD COMMENT
Topic
Name
6+7 =