From: Wolfgang Bangerth Date: Thu, 6 Apr 2017 16:46:33 +0000 (-0600) Subject: Use lambdas to make some code simpler. X-Git-Tag: v9.0.0-rc1~1708^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91da582f196212773bdd9de90636f7aabf5ce616;p=dealii.git Use lambdas to make some code simpler. --- diff --git a/source/fe/fe_system.cc b/source/fe/fe_system.cc index 17b6d44a1e..c5ee6e9090 100644 --- a/source/fe/fe_system.cc +++ b/source/fe/fe_system.cc @@ -1468,27 +1468,27 @@ void FESystem::initialize (const std::vector0) this->base_to_block_indices.push_back( multiplicities[i] ); - std::vector*> > clone_base_elements; - - for (unsigned int i=0; i0) - clone_base_elements.push_back (Threads::new_task (&FiniteElement::clone, - *fes[i])); + { + Threads::TaskGroup<> clone_base_elements; - unsigned int ind=0; - for (unsigned int i=0; i0) { - base_elements[ind] = - std::make_pair (std::shared_ptr > - (clone_base_elements[ind].return_value()), - multiplicities[i]); + clone_base_elements += Threads::new_task ([ &,i,ind] () + { + base_elements[ind] + = std::make_pair (std::shared_ptr>(fes[i]->clone()), + multiplicities[i]); + }); ++ind; } - } + Assert(ind>0, ExcInternalError()); + + // wait for all of these clone operations to finish + clone_base_elements.join_all(); + } - Assert(ind>0, ExcInternalError()); { // If the system is not primitive, these have not been initialized by