threading :: _BoundedSemaphore :: Class _BoundedSemaphore
[hide private]
[frames] | no frames]

Class _BoundedSemaphore

source code

object --+        
         |        
  _Verbose --+    
             |    
    _Semaphore --+
                 |
                _BoundedSemaphore

A bounded semaphore checks to make sure its current value doesn't exceed its initial value. If it does, ValueError is raised. In most situations semaphores are used to guard resources with limited capacity.

Instance Methods [hide private]
 
__init__(self, value=1, verbose=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
release(self)
Release a semaphore, incrementing the internal counter by one.
source code

Inherited from _Semaphore: __enter__, __exit__, acquire

Inherited from _Verbose (private): _note

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, value=1, verbose=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

release(self)

source code 

Release a semaphore, incrementing the internal counter by one.

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.

Overrides: _Semaphore.release