src/Ko/Semaphore.php
public function lockExecute(callable $callable)
    {
        $this->isAcquired = $this->acquire();
        $result = $callable();
        $this->isAcquired = $this->release();

        return $result;
    }
public function lockExecute(callable $callable)
    {
        $this->isAcquired = $this->acquire();
        $result = $callable();
        $this->isAcquired = $this->release();

        return $result;
    }
Lock and execute given callable.

@param callable $callable

@return mixed