vinceTrace
asked on
Pumping messages during Thread.Join(myTimeout)
Hi everybody,
I use a thread to wait until an event occurs.
I create and lauunch the thread, than wait until the threads ends or a timeout is reached.
The problem is (I think), that during Thread.Join(myTimeout) there is no messages pumping, and so no event can be catched !
How could I pump messages ?
Or should I use anything else that Thread.Join method ?
Thank you very much,
Vincent
I use a thread to wait until an event occurs.
I create and lauunch the thread, than wait until the threads ends or a timeout is reached.
The problem is (I think), that during Thread.Join(myTimeout) there is no messages pumping, and so no event can be catched !
How could I pump messages ?
Or should I use anything else that Thread.Join method ?
Thank you very much,
Vincent
....
Thread WaitUntilEventThread = new Thread(new ThreadStart(WaitEventService));
WaitUntilEventThread.Start();
WaitUntilEventThread.Join(myTimeout);
}
private void WaitEventService()
{
while(!isMacroComplete)
{
Thread.Sleep(500);
}
}
private void Pathway_MacroComplete(object sender, MyLib.MyEvent eventArgs)
{
isMacroComplete = true;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.