T
tshad
I am having an issue with debugging threads.
When I press a button, I typically run my process in a thread:
*************************************************
private void btnReProcess_Click(object sender, EventArgs e)
{
Thread oThread = new Thread(new ThreadStart(ReProcessThread));
oThread.Start();
}
private void ReProcessThread()
{
disableButtons();
Maintenance.MoveFiles( this);
enableButtons(true);
}
********************************************************
If I put a breakpoint on the Maintenance.MoveFiles function, the system
seems to freeze for about 20 seconds when it gets to the breakpoint. If I
press the "Step Into" button, the form comes up again and won't continue
until I push the button again. It then goes to the breakpoint again. Then
it normally will continue on and I can step through it. But not always.
The main thread is not doing anything while this is going on (which is why I
put the disableButtons() function there - to prevent that).
Why doesn't the program continue on when I try to step through the first
time?
Thanks,
Tom
When I press a button, I typically run my process in a thread:
*************************************************
private void btnReProcess_Click(object sender, EventArgs e)
{
Thread oThread = new Thread(new ThreadStart(ReProcessThread));
oThread.Start();
}
private void ReProcessThread()
{
disableButtons();
Maintenance.MoveFiles( this);
enableButtons(true);
}
********************************************************
If I put a breakpoint on the Maintenance.MoveFiles function, the system
seems to freeze for about 20 seconds when it gets to the breakpoint. If I
press the "Step Into" button, the form comes up again and won't continue
until I push the button again. It then goes to the breakpoint again. Then
it normally will continue on and I can step through it. But not always.
The main thread is not doing anything while this is going on (which is why I
put the disableButtons() function there - to prevent that).
Why doesn't the program continue on when I try to step through the first
time?
Thanks,
Tom