/* Context switching within the JVM. */
-/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2009-2020. 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. */
JavaContextFactory::JavaContextFactory() : ContextFactory()
{
- xbt_assert(xbt_binary_name && strcmp(xbt_binary_name, "java") == 0); // Set by Java_org_simgrid_msg_Msg_init
+ xbt_assert(xbt::binary_name == "java");
}
JavaContextFactory::~JavaContextFactory()=default;
-JavaContext* JavaContextFactory::create_context(std::function<void()> code, smx_actor_t actor)
+Context* JavaContextFactory::create_context(std::function<void()>&& code, actor::ActorImpl* actor)
{
return this->new_context<JavaContext>(std::move(code), actor);
}
SerialThreadContext::run_all();
}
-JavaContext::JavaContext(std::function<void()> code, smx_actor_t actor)
+JavaContext::JavaContext(std::function<void()>&& code, smx_actor_t actor)
: SerialThreadContext(std::move(code), actor, false /* not maestro */)
{
/* ThreadContext already does all we need */