| 934 | Spinlock CpuCompNode::sm_pool_mtx; |
| 935 | |
| 936 | void CpuCompNode::foreach (thin_function<void(CompNode)> callback) { |
| 937 | if (!sm_pool) |
| 938 | return; |
| 939 | |
| 940 | for (size_t i = 0;; ++i) { |
| 941 | CompNode cur; |
| 942 | { |
| 943 | MGB_LOCK_GUARD(sm_pool->mtx); |
| 944 | if (i >= sm_pool->nr_used_impl_storage) |
| 945 | return; |
| 946 | cur = make_comp_node_from_impl( |
| 947 | reinterpret_cast<CompNodeRecorderImpl*>(&sm_pool->impl_storage[i])); |
| 948 | } |
| 949 | callback(cur); |
| 950 | } |
| 951 | } |
| 952 | |
| 953 | void CpuCompNode::finalize() { |
| 954 | if (sm_pool) { |
nothing calls this directly
no test coverage detected