Does Delphi threadvar work for Parallel.For? : <p>from <a href="http://www.delphibasics.co.uk/RTL.asp?Name=ThreadVar">here</a> it says </p>

<blockquote>
  <p>"The ThreadVar keyword starts a set of variable definitions that are
  used by threads.    Each thread is given a separate instance of each
  variable, thereby avoiding data conflicts, and preserving thread
  independence. "</p>
</blockquote>

<p>So can I use in Parallel.For like this?</p>

<pre><code>threadvar
    threadID: integer;

procedure TForm5.Button1Click(Sender: TObject);
var
 Tot: Integer;
begin
 TParallel.For(1, Max, procedure (I: Integer)
   begin
     threadID := i;  // each thread gets its own threadID?
     if IsPrime (threadID) then
       TInterlocked.Increment (Tot);
   end);
end;
</code></pre>
