Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created September 6, 2015 10:36
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 angelovstanton/da9658f79670023d7c68 to your computer and use it in GitHub Desktop.
Save angelovstanton/da9658f79670023d7c68 to your computer and use it in GitHub Desktop.
volatile bool shouldPartyContinue = true;
public static unsafe void Main(string[] args)
{
Program firstDimension = new Program();
Thread secondDimension = new Thread(firstDimension.StartPartyInAnotherDimension);
secondDimension.Start(firstDimension);
Thread.Sleep(5000);
firstDimension.shouldPartyContinue = false;
Console.WriteLine("Party Grand Finish");
}
private void StartPartyInAnotherDimension(object input)
{
Program currentDimensionInput = (Program)input;
Console.WriteLine("let the party begin");
while (currentDimensionInput.shouldPartyContinue)
{
}
Console.WriteLine("Party ends :(");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment