李
李子
Unregistered / Unconfirmed
GUEST, unregistred user!
我的想法是定义一个线程类getthread,用getthread.creat(true)建立三个(可变化)线程对象,然后向这三个现成传递一些参数,再用getthread.resume唤醒线程,但我发现同时创建两个线程就出错,而一个线程就没有问题,请大家多指教,以下是部分代码。
var
newthread1:getthread1;
newthread2:getthread1;
newthread3:getthread1;
begin
newthread1:=getthread1.create;
newthread1.FreeOnTerminate:=true;
newthread2:=getthread1.create;
newthread2.FreeOnTerminate:=true;
newthread3:=getthread1.create;
newthread3.FreeOnTerminate:=true;
newthread1.getparams(false,'http://www.tphy.com/main.asp',1);
newthread2.getparams(false,'http://www.tphy.com/index.html',2);
newthread3.getparams(false,'http://www.tphy.com/myguest/lyb.htm',3);
newthread1.Resume;
newthread2.Resume;
//《----这里出错
newthread3.Resume;
end;
var
newthread1:getthread1;
newthread2:getthread1;
newthread3:getthread1;
begin
newthread1:=getthread1.create;
newthread1.FreeOnTerminate:=true;
newthread2:=getthread1.create;
newthread2.FreeOnTerminate:=true;
newthread3:=getthread1.create;
newthread3.FreeOnTerminate:=true;
newthread1.getparams(false,'http://www.tphy.com/main.asp',1);
newthread2.getparams(false,'http://www.tphy.com/index.html',2);
newthread3.getparams(false,'http://www.tphy.com/myguest/lyb.htm',3);
newthread1.Resume;
newthread2.Resume;
//《----这里出错
newthread3.Resume;
end;