This is the FIXED pattern - both actions run in same semaphore context
()
| 67 | execution_log.append("child_end") |
| 68 | |
| 69 | def fixed_sequential_execution(): |
| 70 | """This is the FIXED pattern - both actions run in same semaphore context""" |
| 71 | print("1. Acquiring semaphore...") |
| 72 | with semaphore: |
| 73 | print("2. Semaphore acquired") |
| 74 | print("3. Executing parent action...") |
| 75 | parent_action() |
| 76 | print("4. Parent complete, executing child action...") |
| 77 | # Child runs in SAME semaphore context - no re-acquisition needed |
| 78 | child_action() |
| 79 | print("5. Child complete") |
| 80 | print("6. Semaphore released") |
| 81 | |
| 82 | thread = threading.Thread(target=fixed_sequential_execution) |
| 83 | thread.start() |
nothing calls this directly
no test coverage detected