| 154 | # |
| 155 | |
| 156 | class BoundedSemaphore(Semaphore): |
| 157 | |
| 158 | def __init__(self, value=1, *, ctx): |
| 159 | SemLock.__init__(self, SEMAPHORE, value, value, ctx=ctx) |
| 160 | |
| 161 | def __repr__(self): |
| 162 | try: |
| 163 | value = self.get_value() |
| 164 | except Exception: |
| 165 | value = 'unknown' |
| 166 | return '<%s(value=%s, maxvalue=%s)>' % \ |
| 167 | (self.__class__.__name__, value, self._semlock.maxvalue) |
| 168 | |
| 169 | # |
| 170 | # Non-recursive lock |
no outgoing calls
no test coverage detected
searching dependent graphs…