On 06/27/2011 06:38 AM, Malcom Haak wrote:

My issue is it seems that the First instance of this thread works where as all instances after the first do not appear to work correctly. The method only uses variables that are local to the method, and all other variables are actually added to the Thread class. So they should be created new each time a new thread is created.
It should be no problem to instantiate the same TThread sibling multiple times (e.g. using myThread[i] := TmyThread.Create() ). In most projects the instance needs to know which one it is, so it might be sensible to have a property TmyThread.Instance and assign the instance number before the thread runs (or e.g. use Tag):

myThread[i] := TmyThread.Create(True);
myThread[i].Tag := i;
myThread.Suspended := False;

(or similar)

-Michael

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to