芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/vendor/amphp/sync/src/FileMutex.php
fileName = $fileName; } /** * {@inheritdoc} */ public function acquire(): Promise { return new Coroutine($this->doAcquire()); } /** * @coroutine * * @return \Generator */ private function doAcquire(): \Generator { // Try to create the lock file. If the file already exists, someone else // has the lock, so set an asynchronous timer and try again. while (($handle = @\fopen($this->fileName, 'x')) === false) { yield new Delayed(self::LATENCY_TIMEOUT); } // Return a lock object that can be used to release the lock on the mutex. $lock = new Lock(0, function (): void { $this->release(); }); \fclose($handle); return $lock; } /** * Releases the lock on the mutex. * * @throws SyncException If the unlock operation failed. */ protected function release() { $success = @\unlink($this->fileName); if (!$success) { throw new SyncException('Failed to unlock the mutex file.'); } } }