| 11 | namespace processor { |
| 12 | |
| 13 | SemiMaskerLocalState* SemiMaskerSharedState::appendLocalState() { |
| 14 | auto localInfo = std::make_unique<SemiMaskerLocalState>(); |
| 15 | bool isSingle = masksPerTable.size() == 1; |
| 16 | for (const auto& [tableID, vector] : masksPerTable) { |
| 17 | auto& mask = vector.front(); |
| 18 | auto newOne = SemiMaskUtil::createMask(mask->getMaxOffset()); |
| 19 | if (isSingle) { |
| 20 | localInfo->singleTableRef = newOne.get(); |
| 21 | } |
| 22 | localInfo->localMasksPerTable.insert({tableID, std::move(newOne)}); |
| 23 | } |
| 24 | std::unique_lock lock{mtx}; |
| 25 | localInfos.push_back(std::move(localInfo)); |
| 26 | return localInfos[localInfos.size() - 1].get(); |
| 27 | } |
| 28 | |
| 29 | void SemiMaskerSharedState::mergeToGlobal() { |
| 30 | for (const auto& [tableID, globalVector] : masksPerTable) { |
no test coverage detected