Commit a0653c14 authored by Dominik Charousset's avatar Dominik Charousset Committed by Dominik Charousset

Deprecate `priority_aware` flag

parent e6c6f49f
...@@ -127,7 +127,6 @@ public: ...@@ -127,7 +127,6 @@ public:
static constexpr int is_initialized_flag = 0x0010; // event-based actors static constexpr int is_initialized_flag = 0x0010; // event-based actors
static constexpr int is_blocking_flag = 0x0020; // blocking_actor static constexpr int is_blocking_flag = 0x0020; // blocking_actor
static constexpr int is_detached_flag = 0x0040; // local_actor static constexpr int is_detached_flag = 0x0040; // local_actor
static constexpr int is_priority_aware_flag = 0x0080; // local_actor
static constexpr int is_serializable_flag = 0x0100; // local_actor static constexpr int is_serializable_flag = 0x0100; // local_actor
static constexpr int is_migrated_from_flag = 0x0200; // local_actor static constexpr int is_migrated_from_flag = 0x0200; // local_actor
static constexpr int has_used_aout_flag = 0x0400; // local_actor static constexpr int has_used_aout_flag = 0x0400; // local_actor
......
...@@ -523,9 +523,6 @@ private: ...@@ -523,9 +523,6 @@ private:
spawn_impl(actor_config& cfg, Ts&&... xs) { spawn_impl(actor_config& cfg, Ts&&... xs) {
static_assert(is_unbound(Os), static_assert(is_unbound(Os),
"top-level spawns cannot have monitor or link flag"); "top-level spawns cannot have monitor or link flag");
cfg.flags = has_priority_aware_flag(Os)
? abstract_actor::is_priority_aware_flag
: 0;
if (has_detach_flag(Os) || std::is_base_of<blocking_actor, C>::value) if (has_detach_flag(Os) || std::is_base_of<blocking_actor, C>::value)
cfg.flags |= abstract_actor::is_detached_flag; cfg.flags |= abstract_actor::is_detached_flag;
if (has_hide_flag(Os)) if (has_hide_flag(Os))
......
...@@ -65,8 +65,8 @@ constexpr spawn_options detached = spawn_options::detach_flag; ...@@ -65,8 +65,8 @@ constexpr spawn_options detached = spawn_options::detach_flag;
constexpr spawn_options hidden = spawn_options::hide_flag; constexpr spawn_options hidden = spawn_options::hide_flag;
/// Causes the new actor to evaluate message priorities. /// Causes the new actor to evaluate message priorities.
/// @note This implicitly causes the actor to run in its own thread. constexpr spawn_options priority_aware CAF_DEPRECATED =
constexpr spawn_options priority_aware = spawn_options::priority_aware_flag; spawn_options::priority_aware_flag;
/// Causes the new actor to delay its /// Causes the new actor to delay its
/// initialization until a message arrives. /// initialization until a message arrives.
...@@ -86,8 +86,8 @@ constexpr bool has_detach_flag(spawn_options opts) { ...@@ -86,8 +86,8 @@ constexpr bool has_detach_flag(spawn_options opts) {
/// Checks wheter the {@link priority_aware} flag is set in `opts`. /// Checks wheter the {@link priority_aware} flag is set in `opts`.
/// @relates spawn_options /// @relates spawn_options
constexpr bool has_priority_aware_flag(spawn_options opts) { constexpr bool has_priority_aware_flag(spawn_options) {
return has_spawn_option(opts, priority_aware); return true;
} }
/// Checks wheter the {@link hidden} flag is set in `opts`. /// Checks wheter the {@link hidden} flag is set in `opts`.
......
...@@ -43,7 +43,6 @@ std::string to_string(const actor_config& x) { ...@@ -43,7 +43,6 @@ std::string to_string(const actor_config& x) {
add(abstract_channel::is_actor_dot_decorator_flag, "dot_decorator_flag"); add(abstract_channel::is_actor_dot_decorator_flag, "dot_decorator_flag");
add(abstract_actor::is_detached_flag, "detached_flag"); add(abstract_actor::is_detached_flag, "detached_flag");
add(abstract_actor::is_blocking_flag, "blocking_flag"); add(abstract_actor::is_blocking_flag, "blocking_flag");
add(abstract_actor::is_priority_aware_flag, "priority_aware_flag");
add(abstract_actor::is_hidden_flag, "hidden_flag"); add(abstract_actor::is_hidden_flag, "hidden_flag");
result += ")"; result += ")";
return result; return result;
......
...@@ -82,19 +82,8 @@ private: ...@@ -82,19 +82,8 @@ private:
}; };
struct fixture { struct fixture {
fixture() : system(cfg) {
// nop
}
template <spawn_options Os>
void test_message_lifetime() {
// put some preassure on the scheduler (check for thread safety)
for (size_t i = 0; i < 100; ++i)
system.spawn<tester>(system.spawn<testee, Os>());
}
actor_system_config cfg; actor_system_config cfg;
actor_system system; actor_system system{cfg};
}; };
} // namespace <anonymous> } // namespace <anonymous>
...@@ -126,12 +115,9 @@ CAF_TEST(message_lifetime_in_scoped_actor) { ...@@ -126,12 +115,9 @@ CAF_TEST(message_lifetime_in_scoped_actor) {
CAF_CHECK_EQUAL(msg.get_as<int>(0), 42); CAF_CHECK_EQUAL(msg.get_as<int>(0), 42);
} }
CAF_TEST(message_lifetime_no_spawn_options) { CAF_TEST(message_lifetime_in_spawned_actor) {
test_message_lifetime<no_spawn_options>(); for (size_t i = 0; i < 100; ++i)
} system.spawn<tester>(system.spawn<testee>());
CAF_TEST(message_lifetime_priority_aware) {
test_message_lifetime<priority_aware>();
} }
CAF_TEST_FIXTURE_SCOPE_END() CAF_TEST_FIXTURE_SCOPE_END()
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