L
luckystart
Unregistered / Unconfirmed
GUEST, unregistred user!
设计了一个终止所有线程的procedure,
合理吗?
不太懂waitforsingleobject之类的东西。
还有terminateThread是怎么用的呀?
procedure MyForm.FreeThreads;
var
I:integer;
MyThreadList:TList;
begin
MyThreadList:=ThreadList.LockList;
i:=MyThreadList.count-1;
while i>0do
begin
MultiThreads(MyThreadList).Terminate;
MyThreadList.delete(i);
Dec(i);
end;
MyThreadList.clear;
ThreadList.UnlockList;
end;
合理吗?
不太懂waitforsingleobject之类的东西。
还有terminateThread是怎么用的呀?
procedure MyForm.FreeThreads;
var
I:integer;
MyThreadList:TList;
begin
MyThreadList:=ThreadList.LockList;
i:=MyThreadList.count-1;
while i>0do
begin
MultiThreads(MyThreadList).Terminate;
MyThreadList.delete(i);
Dec(i);
end;
MyThreadList.clear;
ThreadList.UnlockList;
end;