X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/39c935d6d5ee86d153f6f7e6a10d723ae7c57f6f..15b76a8173b81f1cc79b9cc01b9f2b67d59c4e0c:/teshsuite/s4u/ns3-from-src-to-itself/ns3-from-src-to-itself.cpp diff --git a/teshsuite/s4u/ns3-from-src-to-itself/ns3-from-src-to-itself.cpp b/teshsuite/s4u/ns3-from-src-to-itself/ns3-from-src-to-itself.cpp index ca8436caaa..49e4c3963f 100644 --- a/teshsuite/s4u/ns3-from-src-to-itself/ns3-from-src-to-itself.cpp +++ b/teshsuite/s4u/ns3-from-src-to-itself/ns3-from-src-to-itself.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2019-2021. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2019-2022. 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,12 +15,10 @@ const int payload = 1000; const int nb_message_to_send = 5; const int nb_sender = 2; -int nb_messages_sent = 0; - -simgrid::s4u::Mailbox* box = simgrid::s4u::Mailbox::by_name("test"); - static void test_send() { + simgrid::s4u::Mailbox* box = simgrid::s4u::Mailbox::by_name("test"); + static int nb_messages_sent = 0; for (int nb_message = 0; nb_message < nb_message_to_send; nb_message++) { nb_messages_sent++; XBT_VERB("start sending test #%i", nb_messages_sent); @@ -31,6 +29,7 @@ static void test_send() static void test_receive() { + simgrid::s4u::Mailbox* box = simgrid::s4u::Mailbox::by_name("test"); for (int nb_message = 0; nb_message < nb_message_to_send * nb_sender; nb_message++) { XBT_VERB("waiting for messages"); auto ptr = box->get_unique();