X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/84a6f8eb1fb1da517b38eb7973eeb4a87bb95085..d8cfc4c2e6eec35703dc7f3158188eaa6e2d24a5:/src/s4u/s4u_Mailbox.cpp?ds=sidebyside diff --git a/src/s4u/s4u_Mailbox.cpp b/src/s4u/s4u_Mailbox.cpp index 3a3c205747..5244567154 100644 --- a/src/s4u/s4u_Mailbox.cpp +++ b/src/s4u/s4u_Mailbox.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2006-2021. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -80,12 +80,12 @@ ActorPtr Mailbox::get_receiver() const { if (pimpl_->permanent_receiver_ == nullptr) return ActorPtr(); - return pimpl_->permanent_receiver_->iface(); + return pimpl_->permanent_receiver_->get_iface(); } CommPtr Mailbox::put_init() { - CommPtr res = CommPtr(new Comm()); + CommPtr res(new Comm()); res->sender_ = kernel::actor::ActorImpl::self(); res->mailbox_ = this; return res; @@ -132,39 +132,12 @@ void Mailbox::put(void* payload, uint64_t simulated_size_in_bytes, double timeou CommPtr Mailbox::get_init() { - CommPtr res = CommPtr(new Comm()); + CommPtr res(new Comm()); res->receiver_ = kernel::actor::ActorImpl::self(); res->mailbox_ = this; return res; } -CommPtr Mailbox::get_async(void** data) -{ - CommPtr res = get_init(); - res->set_dst_data(data, sizeof(*data)); - res->vetoable_start(); - return res; -} - -void* Mailbox::get() -{ - void* res = nullptr; - CommPtr c = get_init(); - c->set_dst_data(&res, sizeof(res)); - c->vetoable_start(); - c->wait(); - return res; -} -void* Mailbox::get(double timeout) -{ - void* res = nullptr; - CommPtr c = get_init(); - c->set_dst_data(&res, sizeof(res)); - c->vetoable_start(); - c->wait_for(timeout); - return res; -} - kernel::activity::ActivityImplPtr Mailbox::iprobe(int type, bool (*match_fun)(void*, void*, kernel::activity::CommImpl*), void* data) { @@ -210,12 +183,12 @@ int sg_mailbox_listen(const char* alias) void* sg_mailbox_get(sg_mailbox_t mailbox) { - return mailbox->get(); + return mailbox->get(); } sg_comm_t sg_mailbox_get_async(sg_mailbox_t mailbox, void** data) { - auto comm = mailbox->get_async(data); + auto comm = mailbox->get_async(data); comm->add_ref(); return comm.get(); }