equal
deleted
inserted
replaced
162 } |
162 } |
163 |
163 |
164 void worker_done_with_task() { |
164 void worker_done_with_task() { |
165 // Mark that the worker is done with the task. |
165 // Mark that the worker is done with the task. |
166 // The worker is not allowed to read the state variables after this line. |
166 // The worker is not allowed to read the state variables after this line. |
167 uint not_finished = Atomic::sub(1u, &_not_finished); |
167 uint not_finished = Atomic::sub(&_not_finished, 1u); |
168 |
168 |
169 // The last worker signals to the coordinator that all work is completed. |
169 // The last worker signals to the coordinator that all work is completed. |
170 if (not_finished == 0) { |
170 if (not_finished == 0) { |
171 _end_semaphore->signal(); |
171 _end_semaphore->signal(); |
172 } |
172 } |