详细说一下吧
我的线程类是这样的:
type
AEvent = procedure ( b: BOOL ) of object;
AThread = class(TThread)
private
FOnData : AEvent;
protected
procedure Execute;
override;
public
property OnData: AEvent write FOnData;
end;
TForm1...
procedure TForm1.xxx( b: BOOL );
var
i : integer;
begin
if b i:=0 else
i:=1;
end;
thread := AThread.create;
thread.onData := xxx;
thread.resume...
这样多个线程调用同一个回调函数,会有问题吗?
函数TForm1.xxx如果使用全局变量有问题吗?