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

Method task

Lib/test/test_thread.py:50–59  ·  view source on GitHub ↗
(self, ident)

Source from the content-addressed store, hash-verified

48 self.running += 1
49
50 def task(self, ident):
51 with self.random_mutex:
52 delay = random.random() / 10000.0
53 verbose_print("task %s will run for %sus" % (ident, round(delay*1e6)))
54 time.sleep(delay)
55 verbose_print("task %s done" % ident)
56 with self.running_mutex:
57 self.running -= 1
58 if self.created == NUMTASKS and self.running == 0:
59 self.done_mutex.release()
60
61 def test_starting_threads(self):
62 with threading_helper.wait_threads_exit():

Callers

nothing calls this directly

Calls 7

verbose_printFunction · 0.85
roundFunction · 0.85
randomMethod · 0.45
sleepMethod · 0.45
releaseMethod · 0.45
appendMethod · 0.45
acquireMethod · 0.45

Tested by

no test coverage detected