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

Method enter

Lib/test/test_thread.py:165–179  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

163 self.checkout_mutex.acquire()
164
165 def enter(self):
166 self.checkin_mutex.acquire()
167 self.waiting = self.waiting + 1
168 if self.waiting == self.num_threads:
169 self.waiting = self.num_threads - 1
170 self.checkout_mutex.release()
171 return
172 self.checkin_mutex.release()
173
174 self.checkout_mutex.acquire()
175 self.waiting = self.waiting - 1
176 if self.waiting == 0:
177 self.checkin_mutex.release()
178 return
179 self.checkout_mutex.release()
180
181
182class BarrierTest(BasicThreadTest):

Callers 4

task2Method · 0.45
test_enterMethod · 0.45
test_enter_concurrentMethod · 0.45
test_run_non_blockingMethod · 0.45

Calls 2

acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected