First attempt at using a threading.Lock()