This is a good article on how to lock code in python. https://superfastpython.com/lock-an-object-in-python/
Essentially any other thread that may be calling that code will wait until it is unlocked
This is a good article on how to lock code in python. https://superfastpython.com/lock-an-object-in-python/
Essentially any other thread that may be calling that code will wait until it is unlocked