-void Comm::wait() {
- xbt_assert(state_ == started || state_ == inited);
-
- if (state_ == started)
- simcall_comm_wait(pimpl_, -1/*timeout*/);
- else { // state_ == inited. Save a simcall and do directly a blocking send/recv
- if (srcBuff_ != nullptr) {
- simcall_comm_send(sender_, mailbox_->getImpl(), remains_, rate_,
- srcBuff_, srcBuffSize_,
- matchFunction_, copyDataFunction_,
- userData_, -1 /*timeout*/);
- } else {
- simcall_comm_recv(receiver_, mailbox_->getImpl(), dstBuff_, &dstBuffSize_,
- matchFunction_, copyDataFunction_,
- userData_, -1/*timeout*/, rate_);
- }
- }
- state_ = finished;
-}
-
-void Comm::wait(double timeout) {
- xbt_assert(state_ == started || state_ == inited);
-
- if (state_ == started) {
- simcall_comm_wait(pimpl_, timeout);
- state_ = finished;
- return;
- }