Commit d4a01972 authored by Dominik Charousset's avatar Dominik Charousset

use const var for fiber::is_disabled_feature

parent 715e1999
...@@ -64,13 +64,13 @@ intrusive_ptr<C> spawn_impl(BeforeLaunch before_launch_fun, Ts&&... args) { ...@@ -64,13 +64,13 @@ intrusive_ptr<C> spawn_impl(BeforeLaunch before_launch_fun, Ts&&... args) {
"top-level spawns cannot have monitor or link flag"); "top-level spawns cannot have monitor or link flag");
CPPA_LOGF_TRACE("spawn " << detail::demangle<C>()); CPPA_LOGF_TRACE("spawn " << detail::demangle<C>());
// runtime check wheter context_switching_resume can be used, // runtime check wheter context_switching_resume can be used,
// i.e., add the detached flag if libcppa compiled without fiber support // i.e., add the detached flag if libcppa was compiled
// when using the blocking API // without fiber support when using the blocking API
if (has_blocking_api_flag(Os) if (has_blocking_api_flag(Os)
&& !has_detach_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, return spawn_impl<C, Os + detached>(before_launch_fun,
std::forward<Ts>(args)...); std::forward<Ts>(args)...);
} }
/* /*
using scheduling_policy = typename std::conditional< using scheduling_policy = typename std::conditional<
......
...@@ -44,7 +44,7 @@ struct fiber { ...@@ -44,7 +44,7 @@ struct fiber {
* @brief Queries whether libcppa was compiled without * @brief Queries whether libcppa was compiled without
* fiber support on this platform. * 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 * @brief Creates a new fiber that describes stores the context
......
...@@ -47,9 +47,7 @@ void fiber::swap(fiber&, fiber&) { ...@@ -47,9 +47,7 @@ void fiber::swap(fiber&, fiber&) {
"CPPA_DISABLE_CONTEXT_SWITCHING"); "CPPA_DISABLE_CONTEXT_SWITCHING");
} }
bool fiber::is_disabled_feature() { const bool fiber::is_disabled_feature = true;
return true;
}
} } // namespace cppa::util } } // namespace cppa::util
...@@ -220,9 +218,7 @@ fiber::~fiber() { ...@@ -220,9 +218,7 @@ fiber::~fiber() {
delete m_impl; delete m_impl;
} }
bool fiber::is_disabled_feature() { const bool fiber::is_disabled_feature = false;
return false;
}
} } // namespace cppa::util } } // 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