X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/08447964cfc19a4b579429ef71c0fccebd60199f..e16ebb1333db2cee332bbfed4098df88777cec22:/src/s4u/s4u_comm.cpp?ds=sidebyside diff --git a/src/s4u/s4u_comm.cpp b/src/s4u/s4u_comm.cpp index 17a66b6ded..6ab47cecb7 100644 --- a/src/s4u/s4u_comm.cpp +++ b/src/s4u/s4u_comm.cpp @@ -141,14 +141,11 @@ void Comm::wait(double timeout) { state_ = finished; } -void Comm::send_detached(MailboxPtr dest, void* data, int simulatedSize) +void Comm::detach() { - s4u::CommPtr res = CommPtr(s4u::Comm::send_init(dest)); - res->setRemains(simulatedSize); - res->srcBuff_ = data; - res->srcBuffSize_ = sizeof(void*); - res->detached_ = true; - res->start(); + xbt_assert(state_ == inited, "You cannot detach communications once they are started."); + xbt_assert(srcBuff_ != nullptr && srcBuffSize_ != 0, "You can only detach sends, not recvs"); + detached_ = true; } s4u::CommPtr Comm::send_async(MailboxPtr dest, void* data, int simulatedSize)