I have set up this thread so my program doesn't hang while I call a cpu
intensive bit of code:
System.Threading.ThreadStart ThreadEncoderStart = new
System.Threading.ThreadStart(myEncoder.EncodeFromC onsole);
System.Threading.Thread Thread_myEncoder = new
System.Threading.Thread(ThreadEncoderStart);
Thread_myEncoder.Name = "myEncoder";
Thread_myEncoder.Priority =
System.Threading.ThreadPriority.BelowNormal;
Thread_myEncoder.Start();
In turn I'm calling this from within a "for loop":
for (int x = 0; x <= lbxVideo.Items.Count -1; x++) {
EncodeThread();
}
My problem is how to I make the threads complete in sequence e.g. first
time around run the thread but make the main thread wait until its
finished before proceeding with the next for statement?
any help would be gratefully appreciated.