]> AND Public Git Repository - simgrid.git/blobdiff - teshsuite/s4u/actor-suspend/actor-suspend.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git] / teshsuite / s4u / actor-suspend / actor-suspend.cpp
index 585f564c2f0d8150d8afade33faee9b56912a1e3..167313ef3be11322f2111d2ee8f619fe0969ce71 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2020-2021. 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. */
@@ -22,7 +22,7 @@ public:
   {
     XBT_INFO("Starting.");
     auto mailbox = simgrid::s4u::Mailbox::by_name("receiver");
-    int data     = *(int*)mailbox->get();
+    int data     = *mailbox->get<int>();
     XBT_INFO("Got %d at the end", data);
   }
 };
@@ -41,7 +41,7 @@ public:
 
     XBT_INFO("Sending a message to the receiver...");
     auto mailbox = simgrid::s4u::Mailbox::by_name("receiver");
-    int data     = 42;
+    static int data = 42;
     mailbox->put(&data, 4);
 
     XBT_INFO("Done!");