我有许多需要运行的线程(大约 160 个)创建文件,然后将它们复制到各个地方:
'Files is basically a list of strings
'which is passed to a function that creates a file from a number of database fields
'when thats done it copies it to a number of places
For Each x In Files
Dim Evaluator = New Thread(Sub() API.Files.Create.Standard(x))
Evaluator.Start()
Next
我想要它做的是关闭 160 个左右的线程(使用许可 x)然后等待所有线程完成,然后继续执行程序的其余部分。