(sensor_index, how_many)
| 133 | counter_lock = Lock() |
| 134 | |
| 135 | def locking_worker(sensor_index, how_many): |
| 136 | global counter |
| 137 | BARRIER.wait() |
| 138 | for _ in range(how_many): |
| 139 | data = read_sensor(sensor_index) |
| 140 | with counter_lock: # Added |
| 141 | counter += get_offset(data) |
| 142 | |
| 143 | |
| 144 | print("Example 7") |
nothing calls this directly
no test coverage detected