I've a question about dynamic invoke and threads. Let's suppose that I have a main thread that in some point shows a dialog.
public void showDialog()
{
lock(mutexObject)
{
flagDialogShowing = true;
showMssgDialog(properties...);
flagDialogShowing = false;
}
}
When I show that Dialog my mainThread get the mutexObject and stops until user click accept button. So my main thread is sleeping. If the user don't push the button and we wait an event is raised in another thread. That events use a dynamicInvoke to call the previous function. In that case mainThread getUp and if I don't use the flagDialog it will be shown a second dialog. It's this correct? What dynamicInvoke does if the thread is not sleeping? it will wait until mainThread is stopped? What happens if I close the two dialogs how it knows where to continue the execution? It stacks different callstacks and know how to recover the old context?
Thank you very much.