芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/cms.mgaplay.com.br/vendor/illuminate/cache/Lock.php
name = $name; $this->owner = $owner; $this->seconds = $seconds; } /** * Attempt to acquire the lock. * * @return bool */ abstract public function acquire(); /** * Release the lock. * * @return void */ abstract public function release(); /** * Returns the owner value written into the driver for this lock. * * @return string */ abstract protected function getCurrentOwner(); /** * Attempt to acquire the lock. * * @param callable|null $callback * @return mixed */ public function get($callback = null) { $result = $this->acquire(); if ($result && is_callable($callback)) { try { return $callback(); } finally { $this->release(); } } return $result; } /** * Attempt to acquire the lock for the given number of seconds. * * @param int $seconds * @param callable|null $callback * @return bool * * @throws \Illuminate\Contracts\Cache\LockTimeoutException */ public function block($seconds, $callback = null) { $starting = $this->currentTime(); while (! $this->acquire()) { usleep(250 * 1000); if ($this->currentTime() - $seconds >= $starting) { throw new LockTimeoutException; } } if (is_callable($callback)) { try { return $callback(); } finally { $this->release(); } } return true; } /** * Returns the current owner of the lock. * * @return string */ public function owner() { return $this->owner; } /** * Determines whether this lock is allowed to release the lock in the driver. * * @return bool */ protected function isOwnedByCurrentProcess() { return $this->getCurrentOwner() === $this->owner; } }