public void ParallelDelete(Action <string> fileOp) { var threads = new Thread[fileSystemParam.Count]; for (int paramIdx = 0; paramIdx < fileSystemParam.Count; paramIdx++) { threads[paramIdx] = new Thread(ThreadDoWork); var threadParameter = new ParallelThreadParameter() { FileOp = fileOp, Param = fileSystemParam[paramIdx] }; threads[paramIdx].Start(threadParameter); } for (int paramIdx = 0; paramIdx < fileSystemParam.Count; paramIdx++) { threads[paramIdx].Join(); } }
public void ParallelDelete(Action<string> fileOp) { var threads = new Thread[fileSystemParam.Count]; for (int paramIdx = 0; paramIdx < fileSystemParam.Count; paramIdx++) { threads[paramIdx] = new Thread(ThreadDoWork); var threadParameter = new ParallelThreadParameter() { FileOp = fileOp, Param = fileSystemParam[paramIdx] }; threads[paramIdx].Start(threadParameter); } for (int paramIdx = 0; paramIdx < fileSystemParam.Count; paramIdx++) { threads[paramIdx].Join(); } }