Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
2d0fb731
Commit
2d0fb731
authored
Apr 17, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
maintenance
parent
82ae3d32
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
cppa/event_based_actor.hpp
cppa/event_based_actor.hpp
+2
-0
src/event_based_actor.cpp
src/event_based_actor.cpp
+9
-4
No files found.
cppa/event_based_actor.hpp
View file @
2d0fb731
...
@@ -51,6 +51,8 @@ class event_based_actor : public event_based_actor_base<event_based_actor>
...
@@ -51,6 +51,8 @@ class event_based_actor : public event_based_actor_base<event_based_actor>
public:
public:
event_based_actor
();
/**
/**
* @brief Terminates this actor with normal exit reason.
* @brief Terminates this actor with normal exit reason.
*/
*/
...
...
src/event_based_actor.cpp
View file @
2d0fb731
...
@@ -32,6 +32,11 @@
...
@@ -32,6 +32,11 @@
namespace
cppa
{
namespace
cppa
{
event_based_actor
::
event_based_actor
()
{
m_loop_stack
.
reserve
(
2
);
}
void
event_based_actor
::
become_void
()
void
event_based_actor
::
become_void
()
{
{
cleanup
(
exit_reason
::
normal
);
cleanup
(
exit_reason
::
normal
);
...
@@ -54,19 +59,19 @@ void event_based_actor::do_become(behavior* bhvr, bool has_ownership)
...
@@ -54,19 +59,19 @@ void event_based_actor::do_become(behavior* bhvr, bool has_ownership)
{
{
reset_timeout
();
reset_timeout
();
request_timeout
(
bhvr
->
timeout
());
request_timeout
(
bhvr
->
timeout
());
stack_element
se
{
bhvr
};
stack_element
new_element
{
bhvr
};
if
(
!
has_ownership
)
se
.
get_deleter
().
disable
();
if
(
!
has_ownership
)
new_element
.
get_deleter
().
disable
();
// keep always the latest element in the stack to prevent subtle errors,
// keep always the latest element in the stack to prevent subtle errors,
// e.g., the addresses of all variables in a lambda expression calling
// e.g., the addresses of all variables in a lambda expression calling
// become() suddenly are invalid if we would pop the behavior!
// become() suddenly are invalid if we would pop the behavior!
if
(
m_loop_stack
.
size
()
<
2
)
if
(
m_loop_stack
.
size
()
<
2
)
{
{
m_loop_stack
.
push_back
(
std
::
move
(
se
));
m_loop_stack
.
push_back
(
std
::
move
(
new_element
));
}
}
else
else
{
{
m_loop_stack
[
0
]
=
std
::
move
(
m_loop_stack
[
1
]);
m_loop_stack
[
0
]
=
std
::
move
(
m_loop_stack
[
1
]);
m_loop_stack
[
1
]
=
std
::
move
(
se
);
m_loop_stack
[
1
]
=
std
::
move
(
new_element
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment