Thank you!
using System;
using System.Threading;
namespace test
{
class test
{
static Thread thr1, thr2;
static void Main(string[] args)
{
thr1 = new Thread (new ThreadStart (threadfunc));
thr1.Start ();
thr2 = new Thread (new ThreadStart (threadfunc2));
thr2.Start ();
}
static void threadfunc ()
{
int i = 0;
while (i<2)
{
Thread.Sleep(1000);
i++;
}
}
static void threadfunc2 ()
{
int i = 0;
while (i<4)
{
if (thr1 != null && thr1.IsAlive)
Console.WriteLine("thr1 rnning");
else
Console.WriteLine ("thr1 is not running");
Thread.Sleep (1000);
i++;
}
}
}
}
|
-- Pablo Baena <[EMAIL PROTECTED]> |
