Jamm\Memory\Shm\MultiAccess::release_access_write PHP Method

release_access_write() public method

public release_access_write ( Jamm\Memory\IKeyLocker $autoUnlocker = NULL )
$autoUnlocker Jamm\Memory\IKeyLocker
    public function release_access_write(IKeyLocker $autoUnlocker = NULL)
    {
        if (!empty($autoUnlocker)) {
            $autoUnlocker->revoke();
        }
        if ($this->writers_count > 0) {
            $this->writers_count--;
        }
        if ($this->writers_count <= 0) {
            $this->decrement(self::writers);
            //tell to readers, that they can read now
            $this->release_writers_mutex();
        }
        return true;
    }