のためにネストされた2つの他のスレッドを作成するメインスレッドがあります。
private void mainthread()
{
List<Thread> ts= new List<Thread>();
for (int w=0; w<7; w+=2)
for (int h = 0; h < 5; h+=3)
{
Thread t = new Thread(delegate() { otherthreads(w, h); });
ts.Add(t);
t.Start();
}
for (int i = 0; i < ts.Count; i++)
ts[i].Join();
}
private void otherthreads(int w, int h)
{
listBox1.Invoke(new singleparam(addtolistbox), new object[] { "w:" + w.ToString() + ",h:" + h.ToString() });
}
各スレッドは、入力引数をリストボックスに追加します。一部のスレッドの入力引数が範囲外にある理由がわかりません。