/**
  * Acquires a @{class:PhabricatorGlobalLock}.
  *
  * @return PhabricatorGlobalLock
  */
 protected final function lock(PhabricatorStorageManagementAPI $api)
 {
     // Although we're holding this lock on different databases so it could
     // have the same name on each as far as the database is concerned, the
     // locks would be the same within this process.
     $lock_name = 'adjust/' . $api->getRef()->getRefKey();
     return PhabricatorGlobalLock::newLock($lock_name)->useSpecificConnection($api->getConn(null))->lock();
 }