Hi
I have second threads that do some jobs in my plugin. Some of these threads must call RunScript (“SaveAs”) , RunScript(“Open”), RunScript(“Save”), RunScript(“Import”) , and then continue with their job after the script is executed. But since these RunScript commands must be called in the main thread, I schedule them to execute in the main thread and make the second thread wait with a lock until the main thread signalizes that it is done.
So the pesudo code is basically this
secondThread()
{
run some code in second thread
shedule code for executing in main thread ( that is the code that calls RunScript)
wait with lock until the main thread completes
continue with executing code in second thread
}
mainThreadCode()
{
bool rslt = RhinoApp().ActiveDoc().RunScript("SaveAs");
notify second thread to continue
}
The problem is that I notify the second thread to continue after RunScript is called. But after call to RunScript is completed it does not mean that the SaveAs command is actually completed. Question is how to signal the second thread to continue when the saveas command is really completed.
I hope my question is clear
Thank you