MCPcopy Create free account
hub / github.com/brmmm3/fastthreadpool / __init__

Method __init__

fastthreadpool/fastthreadpool.py:81–90  ·  view source on GitHub ↗
(self, value=1)

Source from the content-addressed store, hash-verified

79
80 #c def __cinit__(self, int value=1):
81 def __init__(self, value=1): #p
82 if value < 0:
83 raise ValueError("Semaphore: Parameter 'value' must not be less than 0")
84 #c self._lock = pythread.PyThread_allocate_lock()
85 #c if not self._lock:
86 #c raise MemoryError()
87 self._lock = Lock() #p
88 #c pythread.PyThread_acquire_lock(self._lock, pythread.NOWAIT_LOCK)
89 self._lock.acquire(False) #p
90 self._value = value
91
92 #c def __dealloc__(self):
93 #c if self._lock:

Callers

nothing calls this directly

Calls 1

acquireMethod · 0.80

Tested by

no test coverage detected