modules/acm_sku/src/StockManager.php
private function acquireLock(string $sku) {
    $lock_key = self::class . ':' . $sku;
    do {
      $lock_acquired = $this->lock->acquire($lock_key);

      // Sleep for half a second before trying again.
      if (!$lock_acquired) {
        usleep(500000);
      }
    } while (!$lock_acquired);
  }
private function acquireLock(string $sku) {
    $lock_key = self::class . ':' . $sku;
    do {
      $lock_acquired = $this->lock->acquire($lock_key);

      // Sleep for half a second before trying again.
      if (!$lock_acquired) {
        usleep(500000);
      }
    } while (!$lock_acquired);
  }
private function acquireLock ( string $ sku ) { $ lock_key = self :: class . ':' . $ sku ; do { $ lock_acquired = $ this -> lock -> acquire ( $ lock_key ) ; // Sleep for half a second before trying again. if ( ! $ lock_acquired ) { usleep ( 500000 ) ; } } while ( ! $ lock_acquired ) ; }
Helper function to acquire lock.

@param string $sku
SKU string.
Helper function to acquire lock .