Document locks.BoundedSemaphore.

This commit is contained in:
A. Jesse Jiryu Davis 2015-04-04 08:39:11 -04:00
parent 3e4a735f15
commit d2a4a06643
1 changed files with 19 additions and 0 deletions

View File

@ -171,3 +171,22 @@ multithreaded app.)*
# Now the semaphore has been released.
print("Worker %d is done" % worker_id)
BoundedSemaphore
----------------
.. autoclass:: BoundedSemaphore
:members:
:inherited-members:
.. testcode::
sem = locks.BoundedSemaphore()
sem.acquire()
sem.release()
sem.release()
.. testoutput::
Traceback (most recent call last):
...
ValueError: Semaphore released too many times