Synchronisation de threads
Bonjour,
Vous pouvez m'aider un peu sur la synchronisation des threads.
En fait, je veux lancer un traitement dans un thread, et quand ce traitement est terminé, lancer un autre traitement dans ce meme thread.
Merci
Un extrait du code :
Code:
1 2 3 4 5
|
FolderCopy folderCopy = new FolderCopy(this, textBoxEntry.Text, textBoxOut.Text);
this.progressBar1.Maximum = folderCopy.nbreRep;
Thread thread = new Thread(new ThreadStart(folderCopy.StartTraitement));
thread.Start(); |
2e partie du traitement
Code:
1 2 3 4
|
Bordereau bordereau = new Bordereau(textBoxOut.Text + "\\Envoi ok");
bordereau.StartTraitement("Livraison_" + DateTime.Now.ToString("u").Replace(' ', 'T').Replace(':', '-'));
MessageBox.Show("Traitements terminés", "", MessageBoxButton.OK, MessageBoxImage.Information); |