Reputation:
I'm currently learning c# and would like to know where it ends, is it at the t.Start
or does is continue from there or should I call a other method from the threadMethod? Thanks in advance.
private void startThread()
{
Thread t = new Thread(new ThreadStart(threadMethod));
t.Start();
}
private void threadMethod()
{
//do stuff
}
Upvotes: 1
Views: 337
Reputation: 5034
A thread stops when its method has finished or fails, in your case threadMethod().
Upvotes: 4
Reputation: 8462
the thread ends when the threadMethod ends. Notice that by executing threadMethod asynchronously startThread() is going to finish before the threadMethod().
it is probably a good idea to study the multi-threading concept first before going forward with c# ( or at least doing both together ) it will things way easier and faster for you to get to learn
good luck
Upvotes: 0