Learning immediately: https://edu.csdn.net/course/play/26755/340175?utm_source=blogtoedu
Create a thread lock to use local functions, using the method lock.acquire lock, unlock method using lock.release. After locking, any code execution acquire method, will be blocked until the lock is released.