private function init(int $locks)
    {
        $locks = (int) $locks;
        if ($locks < 1) {
            $locks = 1;
        }

        $this->semaphore = new Internal\Semaphore($locks);
        $this->maxLocks = $locks;
    }
private function init(int $locks)
    {
        $locks = (int) $locks;
        if ($locks < 1) {
            $locks = 1;
        }

        $this->semaphore = new Internal\Semaphore($locks);
        $this->maxLocks = $locks;
    }
private function init ( int $ locks ) { $ locks = ( int ) $ locks ; if ( $ locks < 1 ) { $ locks = 1 ; } $ this -> semaphore = new Internal \ Semaphore ( $ locks ) ; $ this -> maxLocks = $ locks ; }
Initializes the semaphore with a given number of locks.

@param int $locks
Initializes the semaphore with a given number of locks .