Code: Select all
threading.Thread
Code: Select all
g_lock = threading.Lock()
def my_threaded_functionality():
try:
g_lock.acquire()
# ... Do something with a shared resource ...
finally:
g_lock.release()
Code: Select all
threading.Thread
Code: Select all
g_lock = threading.Lock()
def my_threaded_functionality():
try:
g_lock.acquire()
# ... Do something with a shared resource ...
finally:
g_lock.release()