def run_upgrades(store, upgrades):
 lock = store.get_lock()
 try:
  run_upgrades_locked(store, upgrades)
 finally:
  store.release_lock(lock)

def run_upgrades ( store , upgrades ) : lock = store . get_lock ( ) try : run_upgrades_locked ( store , upgrades ) finally : store . release_lock ( lock )
guard against concurrent upgrades .