-
-s4u::Comm &Comm::send_init(s4u::MailboxPtr chan) {
- s4u::Comm *res = new s4u::Comm();
- res->sender_ = SIMIX_process_self();
- res->mailbox_ = chan;
- return *res;
-}
-
-s4u::Comm &Comm::recv_init(s4u::MailboxPtr chan) {
- s4u::Comm *res = new s4u::Comm();
- res->receiver_ = SIMIX_process_self();
- res->mailbox_ = chan;
- return *res;
+Comm::~Comm()
+{
+ if (state_ == started && not detached_ && (pimpl_ == nullptr || pimpl_->state == SIMIX_RUNNING)) {
+ XBT_INFO("Comm %p freed before its completion. Detached: %d, State: %d", this, detached_, state_);
+ if (pimpl_ != nullptr)
+ XBT_INFO("pimpl_->state: %d", pimpl_->state);
+ else
+ XBT_INFO("pimpl_ is null");
+ xbt_backtrace_display_current();
+ }