G
Guest
I've created 5 threads to work in my program and I've also created a thread to monitor all 5 threads had still alive or not. Below is part of the monitor thread.
bool[] threadState;
threadState = new bool[num_thread];
threadState.Initialize();
do
{
if (threadState[] == true)
exitLoop = true;
for(int i=1; i <= num_thread;i++)
{
if (!td_work.IsAlive)
{
threadState = true;
}
}
}
while(exitLoop == false);
The question is how can I know the value of the bool array are all true instead of coding method by myself?
many thx~~~
bool[] threadState;
threadState = new bool[num_thread];
threadState.Initialize();
do
{
if (threadState[] == true)
exitLoop = true;
for(int i=1; i <= num_thread;i++)
{
if (!td_work.IsAlive)
{
threadState = true;
}
}
}
while(exitLoop == false);
The question is how can I know the value of the bool array are all true instead of coding method by myself?
many thx~~~