I have two different classes in my project which are responsible for some opening and execution of modules and are called from some other solution. My solution doesn't support multi threading.
Now my problem is -- I have one class CPMModule.cs
public bool QueryLinkActivate()
{
while (true)
{
if (!_cpmBridge.isBlocked() && !_cpmBridge.isClosing())
{
return true;
}
}
}
This method is called to check when module window is ready to handle new call by check _cpmBridge.isBlocked()
and _cpmBridge.isClosing()
values, and when it returns true a new module is opened.
I have another method in another class CallListenerClass.cs -
public void stopModal()
{
_cpmModule.StopModal();
}
This method is responsible to close any pop up window opened in the screen and its associated execution.
Now my problem is like -- A pop up window is opened in my screen and when I close this pop up window the this stopModal()
method execution starts, and some times a new call for QueryLinkActivate()
method comes.
Here in this case stopModal()
execution doesn't get completed and the execution is switched to another method i.e QueryLinkActivate()
in which there is a loop which keeps checking that module is free or not for which stopModal()
execution needs to get completed which never gets completed due to QueryLinkActivate()
while loop. And my application goes in Not responding state which then only can be closed by Task manager.
Can some help how can I handle this situation? How can i complete stopModal()
execution and then resume QueryLinkActivate()
method execution.
Thanks in Advance