diff --git a/src/OSD/OSD_Parallel.hxx b/src/OSD/OSD_Parallel.hxx index 592452a995..3f34408b74 100644 --- a/src/OSD/OSD_Parallel.hxx +++ b/src/OSD/OSD_Parallel.hxx @@ -171,7 +171,14 @@ public: //! @name public methods //! Returns number of logical proccesrs. Standard_EXPORT static Standard_Integer NbLogicalProcessors(); - //! Simple primitive for parallelization of "foreach" loops. + //! Simple primitive for parallelization of "foreach" loops, e.g.: + //! @code + //! for (std::iterator anIter = theBegin; anIter != theEnd; ++anIter) {} + //! @endcode + //! @param theBegin the first index (incusive) + //! @param theEnd the last index (exclusive) + //! @param theFunctor functor providing an interface "void operator(InputIterator theIter){}" performing task for specified iterator position + //! @param isForceSingleThreadExecution if true, then no threads will be created template static void ForEach( InputIterator theBegin, InputIterator theEnd, @@ -179,7 +186,14 @@ public: //! @name public methods const Standard_Boolean isForceSingleThreadExecution = Standard_False ); - //! Simple primitive for parallelization of "for" loops. + //! Simple primitive for parallelization of "for" loops, e.g.: + //! @code + //! for (int anIter = theBegin; anIter < theEnd; ++anIter) {} + //! @endcode + //! @param theBegin the first index (incusive) + //! @param theEnd the last index (exclusive) + //! @param theFunctor functor providing an interface "void operator(int theIndex){}" performing task for specified index + //! @param isForceSingleThreadExecution if true, then no threads will be created template static void For( const Standard_Integer theBegin, const Standard_Integer theEnd, @@ -209,7 +223,7 @@ void OSD_Parallel::ForEach( InputIterator theBegin, { if ( isForceSingleThreadExecution ) { - for ( InputIterator it(theBegin); it != theEnd; it++ ) + for ( InputIterator it(theBegin); it != theEnd; ++it ) theFunctor(*it); return; diff --git a/src/StdPrs/StdPrs_WFShape.cxx b/src/StdPrs/StdPrs_WFShape.cxx index 418e0a3b23..f400871421 100644 --- a/src/StdPrs/StdPrs_WFShape.cxx +++ b/src/StdPrs/StdPrs_WFShape.cxx @@ -173,7 +173,7 @@ void StdPrs_WFShape::Add (const Handle(Prs3d_Presentation)& thePresentation, } StdPrs_WFShape_IsoFunctor anIsoFunctor (*aUPolylinesPtr, *aVPolylinesPtr, aFaces, theDrawer, aShapeDeflection); - OSD_Parallel::For (0, aNbFaces - 1, anIsoFunctor, aNbFaces < 2); + OSD_Parallel::For (0, aNbFaces, anIsoFunctor, aNbFaces < 2); } }