Permalink
Browse files

become no longer execs self->exec_behavior_stack

the automatic invocation of self->exec_behavior_stack unfortunately
breaks `sync_send(...).then(...).continue_with(...)`
  • Loading branch information...
1 parent d75ca6d commit e2832362e5abeb73e75d4743ab2cb8c5737a5c0d @Neverlord Neverlord committed Apr 16, 2013
Showing with 3 additions and 2 deletions.
  1. +2 −0 cppa/message_future.hpp
  2. +0 −2 cppa/stacked.hpp
  3. +1 −0 unit_testing/test_spawn.cpp
View
@@ -36,6 +36,7 @@
#include "cppa/on.hpp"
#include "cppa/atom.hpp"
+#include "cppa/logging.hpp"
#include "cppa/behavior.hpp"
#include "cppa/match_expr.hpp"
#include "cppa/message_id.hpp"
@@ -67,6 +68,7 @@ class message_future {
behavior cpy = ref;
ref = cpy.add_continuation(std::move(fun));
}
+ else CPPA_LOG_WARNING(".continue_with: failed to add continuation");
}
private:
View
@@ -117,7 +117,6 @@ class stacked : public Base {
void become_impl(behavior&& bhvr, bool discard_old, message_id mid) {
auto dthis = util::dptr<Subtype>(this);
- bool exec_afterwards = dthis->m_bhvr_stack.empty();
if (bhvr.timeout().valid()) {
dthis->reset_timeout();
dthis->request_timeout(bhvr.timeout());
@@ -126,7 +125,6 @@ class stacked : public Base {
dthis->m_bhvr_stack.pop_async_back();
}
dthis->m_bhvr_stack.push_back(std::move(bhvr), mid);
- if (exec_afterwards) dthis->exec_behavior_stack();
}
};
@@ -702,6 +702,7 @@ int main() {
self->quit();
}
);
+ self->exec_behavior_stack();
CPPA_ERROR("line " << __LINE__ << " should be unreachable");
}
catch (actor_exited&) {

0 comments on commit e283236

Please sign in to comment.