瀏覽代碼

Fix bug on Ubuntu

Eric Ramat 9 年之前
父節點
當前提交
c7b7df2d04
共有 1 個文件被更改,包括 7 次插入5 次删除
  1. 7 5
      src/paradevs/kernel/pdevs/multithreading/Coordinator.hpp

+ 7 - 5
src/paradevs/kernel/pdevs/multithreading/Coordinator.hpp

@@ -99,14 +99,16 @@ public:
         common::Model < Time >(name),
         pdevs::Coordinator < Time, GraphManager,
                              Parameters, GraphParameters >(name, parameters,
-                                                           graph_parameters),
-        _thread(std::thread([&]{ loop(); }))
-    { type::_graph_manager.init(); }
+                                                           graph_parameters)
+    {
+        type::_graph_manager.init();
+        _thread = new std::thread([&]{ loop(); });
+    }
 
     virtual ~Coordinator()
     {
         done();
-        _thread.join();
+        _thread->join();
     }
 
     void done()
@@ -218,7 +220,7 @@ public:
     }
 
 private:
-    std::thread                _thread;
+    std::thread*               _thread;
     paradevs::common::Receiver _incoming;
     paradevs::common::Sender   _sender;
     unsigned int               _received;