Revision: 75642
          http://sourceforge.net/p/brlcad/code/75642
Author:   starseeker
Date:     2020-04-30 00:25:29 +0000 (Thu, 30 Apr 2020)
Log Message:
-----------
Generate an event from the fb only if the dm isn't already about to do so.

Modified Paths:
--------------
    brlcad/trunk/src/libdm/tests/tcl_img.cpp

Modified: brlcad/trunk/src/libdm/tests/tcl_img.cpp
===================================================================
--- brlcad/trunk/src/libdm/tests/tcl_img.cpp    2020-04-30 00:21:47 UTC (rev 
75641)
+++ brlcad/trunk/src/libdm/tests/tcl_img.cpp    2020-04-30 00:25:29 UTC (rev 
75642)
@@ -455,17 +455,17 @@
     
//////////////////////////////////////////////////////////////////////////////
     
//////////////////////////////////////////////////////////////////////////////
 
-#if 0
-    // Can't do this from Fb in this form - causes a cascading event chain
-    // Generate an event for the manager thread to let it know we're done
-    Tcl_MutexLock(&threadMutex);
-    struct DmRenderEvent *threadEventPtr = (struct DmRenderEvent 
*)ckalloc(sizeof(DmRenderEvent));
-    threadEventPtr->idata = idata;
-    threadEventPtr->event.proc = noop_proc;
-    Tcl_ThreadQueueEvent(idata->dm_id, (Tcl_Event *) threadEventPtr, 
TCL_QUEUE_TAIL);
-    Tcl_ThreadAlert(idata->dm_id);
-    Tcl_MutexUnlock(&threadMutex);
-#endif
+    // Generate an event for the manager thread to let it know we're done, if 
the
+    // display manager isn't already about to generate such an event
+    if (!idata->dm_render_running) {
+       Tcl_MutexLock(&threadMutex);
+       struct DmRenderEvent *threadEventPtr = (struct DmRenderEvent 
*)ckalloc(sizeof(DmRenderEvent));
+       threadEventPtr->idata = idata;
+       threadEventPtr->event.proc = noop_proc;
+       Tcl_ThreadQueueEvent(idata->dm_id, (Tcl_Event *) threadEventPtr, 
TCL_QUEUE_TAIL);
+       Tcl_ThreadAlert(idata->dm_id);
+       Tcl_MutexUnlock(&threadMutex);
+    }
 
     // Render complete, we're done with this thread
     Tcl_ExitThread(TCL_OK);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to