mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 14:10:34 +05:00
TclTodo from parallel thread
This commit is contained in:
parent
b31479b177
commit
085cd6c774
@ -326,6 +326,8 @@ extern "C" {
|
||||
// redraw
|
||||
DLL_HEADER void Ng_Redraw(bool blocking = false);
|
||||
///
|
||||
DLL_HEADER void Ng_TclCmd(string cmd);
|
||||
///
|
||||
DLL_HEADER void Ng_SetMouseEventHandler (netgen::MouseEventHandler * handler);
|
||||
///
|
||||
DLL_HEADER void Ng_SetUserVisualizationObject (netgen::UserVisualizationObject * vis);
|
||||
|
@ -2359,3 +2359,13 @@ void LinkFunction ()
|
||||
{
|
||||
Ng_Redraw();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Ng_TclCmd(string cmd)
|
||||
{
|
||||
#pragma omp critical(tcltodo)
|
||||
{
|
||||
*(multithread.tcl_todo) += cmd;
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ namespace netgen
|
||||
double percent;
|
||||
const char * task;
|
||||
bool demorunning;
|
||||
string * tcl_todo = new string(""); // tcl commands set from parallel thread
|
||||
multithreadt();
|
||||
};
|
||||
|
||||
|
@ -115,7 +115,7 @@ namespace netgen
|
||||
extern DLL_HEADER void Render(bool blocking);
|
||||
DLL_HEADER void Render (bool blocking)
|
||||
{
|
||||
if (blocking)
|
||||
if (blocking && multithread.running)
|
||||
{
|
||||
multithread.redraw = 2;
|
||||
while (multithread.redraw == 2) ;
|
||||
|
@ -705,6 +705,15 @@ namespace netgen
|
||||
strcat (lstring, " 0");
|
||||
Tcl_SetVar (interp, "::status_tetqualclasses", lstring, 0);
|
||||
|
||||
#pragma omp critical(tcltodo)
|
||||
{
|
||||
if (multithread.tcl_todo->length())
|
||||
{
|
||||
Tcl_Eval (interp, multithread.tcl_todo->c_str());
|
||||
*multithread.tcl_todo = "";
|
||||
}
|
||||
}
|
||||
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user