MCPcopy Index your code
hub / github.com/python/cpython / mutate_set

Method mutate_set

Lib/test/test_free_threading/test_set.py:52–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50 result = item in s
51
52 def mutate_set():
53 barrier.wait()
54 for i in range(NUM_LOOPS):
55 s.clear()
56 for j in range(self.SET_SIZE):
57 s.add(j)
58 for j in range(self.SET_SIZE):
59 s.discard(j)
60 # executes the set_swap_bodies() function
61 s.__iand__(set(k for k in range(10, 20)))
62 done.set()
63
64 threads = [Thread(target=read_set), Thread(target=mutate_set)]
65 for t in threads:

Callers

nothing calls this directly

Calls 8

setFunction · 0.85
waitMethod · 0.45
clearMethod · 0.45
addMethod · 0.45
discardMethod · 0.45
__iand__Method · 0.45
setMethod · 0.45
is_setMethod · 0.45

Tested by

no test coverage detected