Commit d4a01972 authored by Dominik Charousset's avatar Dominik Charousset

use const var for fiber::is_disabled_feature

parent 715e1999
......@@ -64,11 +64,11 @@ intrusive_ptr<C> spawn_impl(BeforeLaunch before_launch_fun, Ts&&... args) {
"top-level spawns cannot have monitor or link flag");
CPPA_LOGF_TRACE("spawn " << detail::demangle<C>());
// runtime check wheter context_switching_resume can be used,
// i.e., add the detached flag if libcppa compiled without fiber support
// when using the blocking API
// i.e., add the detached flag if libcppa was compiled
// without fiber support when using the blocking API
if (has_blocking_api_flag(Os)
&& !has_detach_flag(Os)
&& util::fiber::is_disabled_feature()) {
&& util::fiber::is_disabled_feature) {
return spawn_impl<C, Os + detached>(before_launch_fun,
std::forward<Ts>(args)...);
}
......
......@@ -44,7 +44,7 @@ struct fiber {
* @brief Queries whether libcppa was compiled without
* fiber support on this platform.
*/
static bool is_disabled_feature();
static const bool is_disabled_feature;
/**
* @brief Creates a new fiber that describes stores the context
......
......@@ -47,9 +47,7 @@ void fiber::swap(fiber&, fiber&) {
"CPPA_DISABLE_CONTEXT_SWITCHING");
}
bool fiber::is_disabled_feature() {
return true;
}
const bool fiber::is_disabled_feature = true;
} } // namespace cppa::util
......@@ -220,9 +218,7 @@ fiber::~fiber() {
delete m_impl;
}
bool fiber::is_disabled_feature() {
return false;
}
const bool fiber::is_disabled_feature = false;
} } // namespace cppa::util
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment