(self, n=1)
Release a semaphore, incrementing the internal counter by one or more.

        When the counter is zero on entry and another thread is waiting for it
        to become larger than zero again, wake up that thread.

        If the number of releases exceeds the number of acquires,
        raise a ValueError.
Release a semaphore, incrementing the internal counter by one or more.
Release a semaphore incrementing the internal counter by one or more .
def release(self, n=1):
        """Release a semaphore, incrementing the internal counter by one or more.

        When the counter is zero on entry and another thread is waiting for it
        to become larger than zero again, wake up that thread.

        If the number of releases exceeds the number of acquires,
        raise a ValueError.

        """
        if n < 1:
            raise ValueError('n must be one or more')
        with self._cond:
            if self._value + n > self._initial_value:
                raise ValueError("Semaphore released too many times")
            self._value += n
            for i in range(n):
                self._cond.notify()
def release ( self , n = 1 ) : if n < 1 : raise ValueError ( 'n must be one or more' ) with self . _cond : if self . _value + n > self . _initial_value : raise ValueError ( "Semaphore released too many times" ) self . _value += n for i in range ( n ) : self . _cond . notify ( )