Use object lock to protect variables from concurrent access and use download_lock to only allow one download running