From: Martin Quinson Date: Fri, 17 Jun 2016 09:42:55 +0000 (+0200) Subject: no need to save the workers in an array in that example X-Git-Tag: v3_14~975 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/cc273a62587226dabe19f63e0bccfa9691ae1547 no need to save the workers in an array in that example --- diff --git a/examples/s4u/mutex/s4u_mutex.cpp b/examples/s4u/mutex/s4u_mutex.cpp index f1c0eb7ded..2db0ebed5b 100644 --- a/examples/s4u/mutex/s4u_mutex.cpp +++ b/examples/s4u/mutex/s4u_mutex.cpp @@ -46,18 +46,13 @@ static void master() { int result = 0; simgrid::s4u::Mutex mutex; - simgrid::s4u::Actor workers[NB_ACTOR*2]; for (int i = 0; i < NB_ACTOR * 2 ; i++) { // To create a worker use the static method simgrid::s4u::Actor. if((i % 2) == 0 ) - workers[i] = simgrid::s4u::Actor("worker", - simgrid::s4u::Host::by_name("Jupiter"), - workerLockGuard, mutex, std::ref(result)); + simgrid::s4u::Actor("worker", simgrid::s4u::Host::by_name("Jupiter"), workerLockGuard, mutex, std::ref(result)); else - workers[i] = simgrid::s4u::Actor("worker", - simgrid::s4u::Host::by_name("Tremblay"), - worker, mutex, std::ref(result)); + simgrid::s4u::Actor("worker", simgrid::s4u::Host::by_name("Tremblay"), worker, mutex, std::ref(result)); } simgrid::s4u::this_actor::sleep(10);