Search code examples
c#compact-framework

Can you access Thread State in .net Compact Framework?


Is it possible to get Thread state info in compact framework 3.5 ?

Thread th=new Thread(new ThreadStart(DoIT));
th.Start();

Thred.sleep(1000);
th.??? // is thread running, suspended, etc.?

void DoIT(){
  //do stuff in here and exit after some second
}

Solution

  • Officially not supported according to MSDN forums.

    Suggested Workaround: use Join(0) and check return flag. True - terminated, False - still running