- pimpl->links_.erase(name);
-}
-
-/** @brief Returns the amount of storages in the platform */
-size_t Engine::get_storage_count()
-{
- return pimpl->storages_.size();
-}
-
-/** @brief Returns the list of all storages found in the platform */
-std::vector<Storage*> Engine::get_all_storages()
-{
- std::vector<Storage*> res;
- for (auto const& kv : pimpl->storages_)
- res.push_back(kv.second);
- return res;
-}
-
-/** @brief Find a storage from its name.
- *
- * @throw std::invalid_argument if the searched storage does not exist.
- */
-Storage* Engine::storage_by_name(const std::string& name)
-{
- if (pimpl->storages_.find(name) == pimpl->storages_.end())
- throw std::invalid_argument(std::string("Storage not found: ") + name);
-
- return pimpl->storages_.at(name);
-}
-
-/** @brief Find a storage from its name (or nullptr if that storage does not exist) */
-Storage* Engine::storage_by_name_or_null(const std::string& name)
-{
- auto storage = pimpl->storages_.find(name);
- return storage == pimpl->storages_.end() ? nullptr : storage->second;
+ /* two actors may have pushed the same mbox_create simcall at the same time */
+ kernel::activity::MailboxImpl* mbox = kernel::actor::simcall([&name, this] {
+ auto m = pimpl->mailboxes_.emplace(name, nullptr);
+ if (m.second) {
+ m.first->second = new kernel::activity::MailboxImpl(name);
+ XBT_DEBUG("Creating a mailbox at %p with name %s", m.first->second, name.c_str());
+ }
+ return m.first->second;
+ });
+ return mbox->get_iface();