Lines Matching refs:name
26 * @param string $name The index base name to lock
29 public static function acquire(string $name): void argument
31 if (isset(self::$held[$name])) {
32 self::$held[$name]++;
36 $dir = self::lockDir($name);
42 throw new IndexLockException('Could not lock ' . $name);
45 throw new IndexLockException('Could not lock ' . $name);
49 self::$held[$name] = 1;
58 * @param string $name The index base name to unlock
60 public static function release(string $name): void argument
62 if (!isset(self::$held[$name])) return;
64 self::$held[$name]--;
65 if (self::$held[$name] <= 0) {
66 unset(self::$held[$name]);
67 @rmdir(self::lockDir($name));
78 foreach (array_keys(self::$held) as $name) {
79 @rmdir(self::lockDir($name));
87 * @param string $name The index base name
90 protected static function lockDir(string $name): string argument
93 return $conf['lockdir'] . $name . '.index';