Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Joining a thread
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Joining a thread
Divers
Thread ID:
01049204
Message ID:
01049204
Vues:
61
I have a thread that I join using the overload Join method that accepts a timeout parameter and I see something like the following in the output window:
The thread 'The Name of my thread' (0xd88) has exited with code 0 (0x0).
I added some debug/test code to the method that is running in the thread to print stuff to the console. Here is the code I added:
Console.WriteLine("Counter:"+Counter.ToString());
Now the text in the output window will be something like this:
Counter:0
Counter:1
Counter:2
The thread 'The Name of my thread' (0xd88) has exited with code 0 (0x0).
Counter:3
The code is running fine and everything is OK, but why does the line Counter:3 show up after the thread has exited?

Any information on the subject is welcome.

Thanks,
Einar
Semper ubi sub ubi.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform