M
Michael Moreno
Hello,
I am getting a ThreadState value of 12 which I do not know what state
represents
The code is simple and looks like this
private Thread m_Thread;
....
m_Thread = new Thread(new ThreadStart(ThreadLoop));
m_Thread.ApartmentState = ApartmentState.STA;
m_Thread.IsBackground = true;
m_Thread.Priority = ThreadPriority.Normal;
....
MessageBox.Show(m_Thread.ThreadState);
I have tried using a switch statement to find out what the 12 value is
such as:
switch (m_Thread.ThreadState)
{
case System.Threading.ThreadState.Unstarted:
case System.Threading.ThreadState.Stopped:
case System.Threading.ThreadState.Aborted:
case System.Threading.ThreadState.Background:
case System.Threading.ThreadState.Suspended:
case System.Threading.ThreadState.AbortRequested:
case System.Threading.ThreadState.Running:
case System.Threading.ThreadState.StopRequested:
case System.Threading.ThreadState.SuspendRequested:
case System.Threading.ThreadState.WaitSleepJoin:
Trace.Write("known thread State");
break;
default:
Trace.Write("Unknown thread State");
break;
}
but I always end up in the default case.
Do you know what is going on please?
thank you.
I am getting a ThreadState value of 12 which I do not know what state
represents
The code is simple and looks like this
private Thread m_Thread;
....
m_Thread = new Thread(new ThreadStart(ThreadLoop));
m_Thread.ApartmentState = ApartmentState.STA;
m_Thread.IsBackground = true;
m_Thread.Priority = ThreadPriority.Normal;
....
MessageBox.Show(m_Thread.ThreadState);
I have tried using a switch statement to find out what the 12 value is
such as:
switch (m_Thread.ThreadState)
{
case System.Threading.ThreadState.Unstarted:
case System.Threading.ThreadState.Stopped:
case System.Threading.ThreadState.Aborted:
case System.Threading.ThreadState.Background:
case System.Threading.ThreadState.Suspended:
case System.Threading.ThreadState.AbortRequested:
case System.Threading.ThreadState.Running:
case System.Threading.ThreadState.StopRequested:
case System.Threading.ThreadState.SuspendRequested:
case System.Threading.ThreadState.WaitSleepJoin:
Trace.Write("known thread State");
break;
default:
Trace.Write("Unknown thread State");
break;
}
but I always end up in the default case.
Do you know what is going on please?
thank you.