MCPcopy Index your code
hub / github.com/RustPython/RustPython / Semaphore

Class Semaphore

Lib/multiprocessing/synchronize.py:130–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128#
129
130class Semaphore(SemLock):
131
132 def __init__(self, value=1, *, ctx):
133 SemLock.__init__(self, SEMAPHORE, value, SEM_VALUE_MAX, ctx=ctx)
134
135 def get_value(self):
136 return self._semlock._get_value()
137
138 def __repr__(self):
139 try:
140 value = self._semlock._get_value()
141 except Exception:
142 value = 'unknown'
143 return '<%s(value=%s)>' % (self.__class__.__name__, value)
144
145#
146# Bounded semaphore

Callers 1

SemaphoreMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected