-/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2019. 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. */
class ActorImpl : public simgrid::surf::PropertyHolder {
public:
- ActorImpl() : piface_(this) {}
+ ActorImpl(simgrid::xbt::string name, simgrid::s4u::Host* host);
~ActorImpl();
void set_auto_restart(bool autorestart) { auto_restart_ = autorestart; }
smx_activity_t sleep(double duration);
void set_user_data(void* data) { userdata_ = data; }
void* get_user_data() { return userdata_; }
+ /** Ask the actor to throw an exception right away */
+ void throw_exception(std::exception_ptr e);
};
class ProcessArg {
double kill_time = 0.0;
std::shared_ptr<std::unordered_map<std::string, std::string>> properties = nullptr;
bool auto_restart = false;
+ bool daemon_ = false;
ProcessArg() = default;
explicit ProcessArg(std::string name, std::function<void()> code, void* data, s4u::Host* host, double kill_time,
, host(host)
, kill_time(SIMIX_timer_get_date(actor->kill_timer))
, auto_restart(actor->auto_restart_)
+ , daemon_(actor->is_daemon())
{
properties.reset(actor->get_properties(), [](decltype(actor->get_properties())) {});
}
typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
-XBT_PRIVATE smx_actor_t SIMIX_process_create(const char* name, std::function<void()> code, void* data, sg_host_t host,
+XBT_PRIVATE smx_actor_t SIMIX_process_create(std::string name, std::function<void()> code, void* data, sg_host_t host,
std::unordered_map<std::string, std::string>* properties,
smx_actor_t parent_process);