请教一个线程小问题
public class ClassA
protected shared AL as arraylist
protected shared Th as new threading.thread( addressof(ThFun) )
'空的私有构造函数
private sub new()
end sub
'经常被外部调用的静态函数
public shared function AlwaysBeCalledFun
if th.threadstate = threadstate.unstart '忘记这个词了,就是没有开始运行的意思
th.start
end if
……
end function
public shared fucntion ThFun
for i as integer = 0 to 1000
AL.add(i) '此句
next
end function
end class
我调试的时候发现 AL.add(i) 执行了,但即时窗口的?al.count还是没有变化,为什么?