Mercurial > hg > orthanc
changeset 770:a64ca424e0e2 lua-scripting
fix test
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 24 Apr 2014 12:01:05 +0200 |
parents | 476febedc516 |
children | d3ba35466225 |
files | UnitTestsSources/MultiThreading.cpp |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/UnitTestsSources/MultiThreading.cpp Wed Apr 23 17:23:18 2014 +0200 +++ b/UnitTestsSources/MultiThreading.cpp Thu Apr 24 12:01:05 2014 +0200 @@ -796,10 +796,10 @@ }; -static void Tata(ServerScheduler* s, ServerJob* j) +static void Tata(ServerScheduler* s, ServerJob* j, bool* done) { #if 1 - for (;;) + while (!(*done)) { ListOfStrings l; s->GetListOfJobs(l); @@ -840,7 +840,8 @@ job.SetDescription("tutu"); - boost::thread t(Tata, &scheduler, &job); + bool done = false; + boost::thread t(Tata, &scheduler, &job, &done); //scheduler.Submit(job); @@ -856,5 +857,6 @@ //Toolbox::ServerBarrier(); //Toolbox::USleep(3000000); - //t.join(); + done = true; + t.join(); }