Revision: 75847
          http://sourceforge.net/p/brlcad/code/75847
Author:   brlcad
Date:     2020-05-20 17:07:44 +0000 (Wed, 20 May 2020)
Log Message:
-----------
something's not right.  threads don't appeear to be running asynchronously, so 
this stalls out every time on bsd and mac.  add some debugging statements, 
ditch the vector.

Modified Paths:
--------------
    brlcad/trunk/regress/pkg/regress_pkg.cpp

Modified: brlcad/trunk/regress/pkg/regress_pkg.cpp
===================================================================
--- brlcad/trunk/regress/pkg/regress_pkg.cpp    2020-05-20 14:27:39 UTC (rev 
75846)
+++ brlcad/trunk/regress/pkg/regress_pkg.cpp    2020-05-20 17:07:44 UTC (rev 
75847)
@@ -12,12 +12,16 @@
  *
  */
 
+#include "common.h"
+
 #include <cstdlib>
 #include <iostream>
 #include <thread>
 #include <vector>
+
 #include "bu/app.h"
 
+
 class cmd_result {
     public:
        int cmd_ret = 0;
@@ -54,15 +58,20 @@
     c.cmd = std::string(argv[2]);
 
     // Launch the client and server
-    std::vector<std::thread> t;
-    t.push_back(std::thread(run_server, std::ref(s)));
-    t.push_back(std::thread(run_client, std::ref(c)));
+    std::cout << "Launching server" << std::endl;
+    std::thread server(run_server, std::ref(s));
+    std::this_thread::sleep_for(std::chrono::milliseconds(1000));
 
-    // Wait for both commands to finish up
-    for (int i = 0; i < 2; i++) {
-       t[i].join();
-    }
+    std::cout << "Launching client" << std::endl;
+    std::thread client(run_client, std::ref(c));
+    std::this_thread::sleep_for(std::chrono::milliseconds(1000));
 
+    // Wait for both to finish up, client first so we know it tried
+    std::cout << "Waiting for client to exit" << std::endl;
+    client.join();
+    std::cout << "Waiting for server to exit" << std::endl;
+    server.join();
+
     // If either client or server had a problem, overall test fails
     return (s.cmd_ret || c.cmd_ret) ? 1 : 0;
 }

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