Autor Beitrag
coolace
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 141



BeitragVerfasst: Fr 27.08.10 14:54 
Hy,

ist mir fast schon peinlich aber ich bin mir nicht mehr sicher da ich mit
Threads schon lange nichts mehr gemacht habe.

Ich rufe wie folgt einen Thread auf
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
ParameterizedThreadStart bla= new ParameterizedThreadStart(handleThread);
Thread t = new Thread(bla);
t.Start(irgendwas);


public static void handleThread(Object blub)
{
    Code ............
}


Nun meine Frage, muss ich den Thread irgendwie wieder freigeben sprich nach t.Start(irgendwas)
so eine Art t.Abort() ?

Gruß

Coolace
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4807
Erhaltene Danke: 1061

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Fr 27.08.10 15:11 
Nein, brauchst du nicht.
Der Thread beendet sich ja automatisch sobald die Thread-Methode verlassen wird (mittels return bzw. am Ende der Methode und bei einer Exception).
coolace Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 141



BeitragVerfasst: Fr 27.08.10 15:13 
Dankeschön für die Antwort.

Gruß

Coolace