Commit d92998a7 authored by Denis Bilenko's avatar Denis Bilenko

use docstring from stdlib's Semaphore

parent a0da00cd
...@@ -8,11 +8,11 @@ from gevent.timeout import Timeout ...@@ -8,11 +8,11 @@ from gevent.timeout import Timeout
class Semaphore(object): class Semaphore(object):
"""An unbounded semaphore. """A semaphore manages a counter representing the number of release() calls minus the number of acquire() calls,
Optionally initialize with a resource count, then acquire() and release() plus an initial value. The acquire() method blocks if necessary until it can return without making the counter
resources as needed. Attempting to acquire() when count is zero suspends negative.
the calling coroutine until count becomes nonzero again.
""" If not given, value defaults to 1."""
def __init__(self, count=0): def __init__(self, count=0):
self._links = [] self._links = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment