X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ea74f5d95928a521a588737e81f1de94eef25d19..c4c82977e0a105cdf7b04010ddd21bbf15dced4d:/examples/cpp/app-bittorrent/s4u-tracker.cpp diff --git a/examples/cpp/app-bittorrent/s4u-tracker.cpp b/examples/cpp/app-bittorrent/s4u-tracker.cpp index c3adb04f6e..c74207239c 100644 --- a/examples/cpp/app-bittorrent/s4u-tracker.cpp +++ b/examples/cpp/app-bittorrent/s4u-tracker.cpp @@ -1,5 +1,4 @@ -/* Copyright (c) 2012-2022. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2012-2023. 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. */ @@ -8,6 +7,7 @@ #include XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_bt_tracker, "Messages specific for the tracker"); +namespace sg4 = simgrid::s4u; Tracker::Tracker(std::vector args) { @@ -21,16 +21,16 @@ Tracker::Tracker(std::vector args) } xbt_assert(deadline > 0, "Wrong deadline supplied"); - mailbox = simgrid::s4u::Mailbox::by_name(TRACKER_MAILBOX); + mailbox = sg4::Mailbox::by_name(TRACKER_MAILBOX); XBT_INFO("Tracker launched."); } void Tracker::operator()() { - simgrid::s4u::CommPtr comm = nullptr; + sg4::CommPtr comm = nullptr; TrackerQuery* query = nullptr; - while (simgrid::s4u::Engine::get_clock() < deadline) { + while (sg4::Engine::get_clock() < deadline) { if (comm == nullptr) comm = mailbox->get_async(&query); if (comm->test()) { @@ -59,7 +59,7 @@ void Tracker::operator()() delete query; comm = nullptr; } else { - simgrid::s4u::this_actor::sleep_for(1); + sg4::this_actor::sleep_for(1); } } XBT_INFO("Tracker is leaving");