Closed MauricDaniel closed 4 years ago
Man! You are absolutely right!!! The code was working as variable i was already High(Threads) due to the previous for loop, but since we are talking about Pascal here, the contents of variable i should be considered undefined after a for loop. Thanks so much for spotting this out! What an eye!
In function TncThreadPool.RequestReadyThread: TncReadyThread
the variable
i
used for thread index is not defined:Threads[ High(Threads)].Priority := Threads[0].Priority;
Threads[i].ReadyEvent.WaitFor(1000);
I guess it's supposed to be
High(Threads)
instead ofi
, can you verify that ?