X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/29a3b2869c0075fc75e8ccc66fc1d9c4c8bf6a85..2c0aa88e3d941e79fc79d39e3e58224d282b76d3:/examples/s4u/synchro-semaphore/s4u-synchro-semaphore.cpp diff --git a/examples/s4u/synchro-semaphore/s4u-synchro-semaphore.cpp b/examples/s4u/synchro-semaphore/s4u-synchro-semaphore.cpp index 71532b8363..ed5a2b82ed 100644 --- a/examples/s4u/synchro-semaphore/s4u-synchro-semaphore.cpp +++ b/examples/s4u/synchro-semaphore/s4u-synchro-semaphore.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2006-2020. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -15,9 +15,8 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "a sample log category"); const char* buffer; /* Where the data is exchanged */ simgrid::s4u::SemaphorePtr sem_empty = simgrid::s4u::Semaphore::create(1); /* indicates whether the buffer is empty */ simgrid::s4u::SemaphorePtr sem_full = simgrid::s4u::Semaphore::create(0); /* indicates whether the buffer is full */ -; -static void producer(std::vector* args) +static void producer(const std::vector* args) { for (auto str : *args) { sem_empty->acquire(); @@ -43,7 +42,7 @@ static void consumer() int main(int argc, char **argv) { - std::vector args = std::vector({"one", "two", "three", ""}); + std::vector args({"one", "two", "three", ""}); simgrid::s4u::Engine e(&argc, argv); e.load_platform("../../platforms/two_hosts.xml"); simgrid::s4u::Actor::create("producer", simgrid::s4u::Host::by_name("Tremblay"), producer, &args);