(child_name, context_stack)
| 204 | orig_stack = _global_context_stack.stack |
| 205 | |
| 206 | def run_with_child_context(child_name, context_stack): |
| 207 | self.assertIsNot(context_stack, orig_stack) |
| 208 | self.assertIs(_global_context_stack.stack, orig_stack) |
| 209 | # A thread should install the cloned context stack first. |
| 210 | install_context_stack(context_stack) |
| 211 | self.assertIs(_global_context_stack.stack, context_stack) |
| 212 | |
| 213 | # Now child_context() between different threads will not interfere with each other. |
| 214 | with child_context(child_name): |
| 215 | x = current_context().state["x"] # pytype: disable=attribute-error |
| 216 | xs.add(x) |
| 217 | barrier.wait() |
| 218 | |
| 219 | threads = [] |
| 220 | for child_name in ("child1", "child2"): |
nothing calls this directly
no test coverage detected