public function release() { IoUtils::flock($this->resource, LOCK_UN); if (!$this->exclusive && !flock($this->resource, LOCK_EX | LOCK_NB)) { fclose($this->resource); return; } fclose($this->resource); IoUtils::unlink($this->fileName); }