| 4 | namespace processor { |
| 5 | |
| 6 | FactorizedTable* FactorizedTablePool::claimLocalTable(storage::MemoryManager* mm) { |
| 7 | std::unique_lock<std::mutex> lck{mtx}; |
| 8 | if (availableLocalTables.empty()) { |
| 9 | auto table = std::make_shared<FactorizedTable>(mm, globalTable->getTableSchema()->copy()); |
| 10 | localTables.push_back(table); |
| 11 | availableLocalTables.push(table.get()); |
| 12 | } |
| 13 | auto result = availableLocalTables.top(); |
| 14 | availableLocalTables.pop(); |
| 15 | return result; |
| 16 | } |
| 17 | |
| 18 | void FactorizedTablePool::returnLocalTable(FactorizedTable* table) { |
| 19 | std::unique_lock<std::mutex> lck{mtx}; |
no test coverage detected