D
davebythesea
Hi folks,
In the following code I create a thread and start it. I then call
Thread.Sleep() within that thread. Will this cause the thread I created to
Sleep or will it cause the main application Thread to sleep? I'm hoping it
will cause the created Thread to sleep...
class A
{
private Thread thread;
public A()
{
thread = new Thread(new ThreadStart(Sync));
thread.IsBackground = true;
thread.Priority = ThreadPriority.Normal;
thread.Start();
}
private void Sync()
{
while (true)
{
Thread.Sleep(10000);
// do stuff
}
}
}
In the following code I create a thread and start it. I then call
Thread.Sleep() within that thread. Will this cause the thread I created to
Sleep or will it cause the main application Thread to sleep? I'm hoping it
will cause the created Thread to sleep...
class A
{
private Thread thread;
public A()
{
thread = new Thread(new ThreadStart(Sync));
thread.IsBackground = true;
thread.Priority = ThreadPriority.Normal;
thread.Start();
}
private void Sync()
{
while (true)
{
Thread.Sleep(10000);
// do stuff
}
}
}