threading.Semaphore()¶
-
threading.Semaphore(*args, **kwargs)[source]¶ A factory function that returns a new semaphore.
Semaphores manage a counter representing the number of release() calls minus the number of acquire() calls, plus an initial value. The acquire() method blocks if necessary until it can return without making the counter negative. If not given, value defaults to 1.