TMtxForLoop::CancelProcessing Method

void CancelProcessing();

Call to cancel the processing.

Remarks:

This will indicate that looping should stop, but to quit any processing within threaded procedure has to be checked by the procedure explicitely.

procedure MyLoopRange(IdxStart, IdxEnd: integer; const Context: TObjectArray; ThreadIndex: integer);
var j, k: integer;
    a: TMtx;
begin
    a := TMtx(Context[0]);

    for k := IdxStart to IdxEnd do //additional vectorization possible inside these two loops
    begin
        for j := 0 to a.Cols - 1 do
        begin
            a[k, j] := a[k, j] + 1;
        end;

        //Check, if we need to finish prematurely
        mtxForLoop[ThreadIndex].CancelProcessing then Exit;
    end;
end;
Declared in Dew::Math::TMtxForLoop · Dew.Math/MtxForLoop.h · Cross-compiler