MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / thread_fn

Method thread_fn

tensorflow/python/util/lock_util_test.py:38–47  ·  view source on GitHub ↗
(thread_id)

Source from the content-addressed store, hash-verified

36 finished = set()
37
38 def thread_fn(thread_id):
39 time.sleep(random.random() * 0.1)
40 group_id = thread_id % num_groups
41 with lock.group(group_id):
42 time.sleep(random.random() * 0.1)
43 self.assertGreater(lock._group_member_counts[group_id], 0)
44 for g, c in enumerate(lock._group_member_counts):
45 if g != group_id:
46 self.assertEqual(0, c)
47 finished.add(thread_id)
48
49 threads = [
50 self.checkedThread(target=thread_fn, args=(i,))

Callers

nothing calls this directly

Calls 3

sleepMethod · 0.45
groupMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected