Skip to content

Instantly share code, notes, and snippets.

@EgorBo
Created October 6, 2017 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EgorBo/81110d1add96440ca716d30c7071eacf to your computer and use it in GitHub Desktop.
Save EgorBo/81110d1add96440ca716d30c7071eacf to your computer and use it in GitHub Desktop.
using System.Threading;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
var t = new Thread(() => { });
t.IsBackground = true;
t.Start();
t.Join(30000);
t.IsBackground = false;
//.NET: System.Threading.ThreadStateException: Thread is dead; state cannot be accessed:
// Mono: no exception
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment