D
dzx_zjg
Unregistered / Unconfirmed
GUEST, unregistred user!
过程如下:
procedure TMain_Form.ServerSocket1GetThread(Sender: TObject;
ClientSocket: TServerClientWinSocket;
var SocketThread: TServerClientThread);
var
i:integer;
begin
for i:=0 to MaxSessionNum-1do
begin
if not DMArrayUsed then
begin
DMArrayUsed:=true;
SocketThread:=FrontThread.Create(false,ClientSocket,DMArray);
exit;
end;
end;
end.
DMArrayUsed初始均为false,thread结束后DMArrayUsed是否能自动置为false,如果能,是在什么时候;如不能,应在线程内还是线程外置回?
procedure TMain_Form.ServerSocket1GetThread(Sender: TObject;
ClientSocket: TServerClientWinSocket;
var SocketThread: TServerClientThread);
var
i:integer;
begin
for i:=0 to MaxSessionNum-1do
begin
if not DMArrayUsed then
begin
DMArrayUsed:=true;
SocketThread:=FrontThread.Create(false,ClientSocket,DMArray);
exit;
end;
end;
end.
DMArrayUsed初始均为false,thread结束后DMArrayUsed是否能自动置为false,如果能,是在什么时候;如不能,应在线程内还是线程外置回?