Commit e34ec347 authored by Mohcine Chraibi's avatar Mohcine Chraibi

sleep after creating source thread

Sometimes the source thread does not start immediately.
This fix seems to help.
parent 028e04d2
Pipeline #9205 failed with stages
in 6 minutes and 16 seconds
...@@ -86,8 +86,9 @@ int main(int argc, char** argv) ...@@ -86,8 +86,9 @@ int main(int argc, char** argv)
//Start the thread for managing the sources of agents if any //Start the thread for managing the sources of agents if any
//std::thread t1(sim.GetAgentSrcManager()); //std::thread t1(sim.GetAgentSrcManager());
double simMaxTime = configuration->GetTmax(); double simMaxTime = configuration->GetTmax();
std::thread t1(&AgentsSourcesManager::Run, &sim.GetAgentSrcManager());//@todo pass simMaxTime to Run std::thread t1(&AgentsSourcesManager::Run, &sim.GetAgentSrcManager());
//main thread for the simulation std::this_thread::sleep_for(std::chrono::milliseconds(100));
//main thread for the simulation
evacTime = sim.RunStandardSimulation(simMaxTime); evacTime = sim.RunStandardSimulation(simMaxTime);
//Join the main thread //Join the main thread
t1.join(); t1.join();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment