PR #3279 - Made the timestep tree thread safe

This commit is contained in:
godeffroy 2020-09-16 14:03:59 +02:00
parent 1fa2e4ebcc
commit 23944b97db

View File

@ -109,7 +109,7 @@ private:
// TreeNode implementation
template<class NodeDataT, class ChildDataT>
TreeNode<NodeDataT>* add_child(TreeNode<NodeDataT>* node, ChildDataT&& data_) {
static godefv::memory::object_pool_t<TreeNode<NodeDataT>> tree_node_pool;
static thread_local godefv::memory::object_pool_t<TreeNode<NodeDataT>> tree_node_pool;
node->children.push_back(tree_node_pool.make_unique(node, std::forward<ChildDataT>(data_)));
return node->children.back().get();
}