I seem to fail to create a foreground task. my main thread is supppose to call another thread and then exit. the other thread suppose to run forever
void MainThreadMain()
{
task_main = Task.Factory.StartNew(() => OtherThread()) ;
return;
}
void OtherThread()
{
while(true)
{
TellChuckNorrisJoke();
}
}
how can I ensure task_main will continue running even that Main Thread is dead? I assumed il do:
task_main.IsBackgorund = false;
but no such option :\ I can make my main thread to wait a signal from my other thread that it passed to Foreground mode. but thats plain silly.