K
Kovan Akrei
Hi,
When I check whether one my thread are running I use a bitmask like this:
(myThread.ThreadState & (ThreadState.Stopped | ThreadState.Unstarted)) == 0
(got it from MSDN)
How would I check whether a thread has been started or not without using the
property IsAlive? I'm trying to use a bit mask like this;
if ((myThread.ThreadState | ThreadState.Unstarted) = = 8)
myThread.Start();
but I get an error message :
Operator '= =' cannot be applied to operands of type
'System.Threading.ThreadState' and 'int'.
I'm I doing something wrong? I can fix this by retyping av the bitmask to
(int), but I was wondering if there is another way to bitmask and get the
right result?
Regards from
Kovan
When I check whether one my thread are running I use a bitmask like this:
(myThread.ThreadState & (ThreadState.Stopped | ThreadState.Unstarted)) == 0
(got it from MSDN)
How would I check whether a thread has been started or not without using the
property IsAlive? I'm trying to use a bit mask like this;
if ((myThread.ThreadState | ThreadState.Unstarted) = = 8)
myThread.Start();
but I get an error message :
Operator '= =' cannot be applied to operands of type
'System.Threading.ThreadState' and 'int'.
I'm I doing something wrong? I can fix this by retyping av the bitmask to
(int), but I was wondering if there is another way to bitmask and get the
right result?
Regards from
Kovan