Skip to main content
GameDev.net gamedev.net
šŸ”’ Locked šŸŽ® Unity

C# Threads and Scope

Started by Justin Rebuilt Jan 24, 2008 at 11:39 AM 0 replies 500+ views
Original Post
Justin Rebuilt
Justin Rebuilt
Do threads go out of scope like other objects in C#? Example:

public void test(string s)
{
     Thread thd = new Thread(delegate()
     {
          Console.WriteLine(s);
     });
     thd.Start();
}


EDIT: I did some testing and I see it goes out of scope properly, but is it safely disposed. If not, do I need to explicitly destroy the thread myself?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.