Revision: 76659
http://sourceforge.net/p/brlcad/code/76659
Author: starseeker
Date: 2020-08-04 12:23:23 +0000 (Tue, 04 Aug 2020)
Log Message:
-----------
Wait after the callback execution, not between the status check and the call.
Modified Paths:
--------------
brlcad/branches/bioh/src/gtools/gsh.cpp
Modified: brlcad/branches/bioh/src/gtools/gsh.cpp
===================================================================
--- brlcad/branches/bioh/src/gtools/gsh.cpp 2020-08-04 02:01:11 UTC (rev
76658)
+++ brlcad/branches/bioh/src/gtools/gsh.cpp 2020-08-04 12:23:23 UTC (rev
76659)
@@ -52,8 +52,7 @@
collect_io(struct ged_subprocess *p, ged_io_func_t callback, void *data)
{
std::string pstr(bu_vls_cstr(p->gedp->ged_result_str));
- while (!p->done) {
- std::this_thread::sleep_for(std::chrono::milliseconds(100));
+ while (p && !p->done) {
(*callback)(data, 0);
std::string nstr;
std::string cstr = std::string(bu_vls_cstr(p->gedp->ged_result_str));
@@ -66,6 +65,7 @@
printf("%s", nstr.c_str());
pstr = cstr;
}
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
}
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