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