Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[s4u] Activity ought not to be copied
authorGabriel Corona <gabriel.corona@loria.fr>
Fri, 22 Jul 2016 08:12:05 +0000 (10:12 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Fri, 22 Jul 2016 08:12:05 +0000 (10:12 +0200)
include/simgrid/s4u/Activity.hpp
src/s4u/s4u_actor.cpp

index fae7fb8..0b8d303 100644 (file)
@@ -33,6 +33,9 @@ protected:
   virtual ~Activity();
 
 public:
+  Activity(Activity const&) = delete;
+  Activity& operator=(Activity const&) = delete;
+
   /** Starts a previously created activity.
    *
    * This function is optional: you can call wait() even if you didn't call start()
index d8ad4a2..c53f54a 100644 (file)
@@ -130,14 +130,14 @@ e_smx_state_t execute(double flops) {
 
 void* recv(Mailbox &chan) {
   void *res = nullptr;
-  Comm c = Comm::recv_init(chan);
+  Comm& c = Comm::recv_init(chan);
   c.setDstData(&res,sizeof(res));
   c.wait();
   return res;
 }
 
 void send(Mailbox &chan, void *payload, size_t simulatedSize) {
-  Comm c = Comm::send_init(chan);
+  Comm& c = Comm::send_init(chan);
   c.setRemains(simulatedSize);
   c.setSrcData(payload);
   // c.start() is optional.