matchFunction_, cleanFunction_, copyDataFunction_,
userData_, detached_);
} else if (dstBuff_ != nullptr) { // Receiver side
+ xbt_assert(not detached_, "Receive cannot be detached");
pimpl_ = simcall_comm_irecv(receiver_, mailbox_->getImpl(), dstBuff_, &dstBuffSize_,
matchFunction_, copyDataFunction_,
userData_, rate_);
bool Comm::test() {
xbt_assert(state_ == inited || state_ == started || state_ == finished);
- if (state_ == finished)
- xbt_die("Don't call test on a finished comm.");
+ if (state_ == finished) {
+ return true;
+ }
if (state_ == inited) {
this->start();