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
425aa491
Commit
425aa491
authored
Oct 25, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed event-based message processing for context-switching and thread-mapped actors
parent
d04af15c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
7 deletions
+14
-7
cppa/detail/behavior_stack.hpp
cppa/detail/behavior_stack.hpp
+1
-0
cppa/detail/receive_policy.hpp
cppa/detail/receive_policy.hpp
+7
-7
cppa/detail/stacked_actor_mixin.hpp
cppa/detail/stacked_actor_mixin.hpp
+2
-0
cppa/thread_mapped_actor.hpp
cppa/thread_mapped_actor.hpp
+4
-0
No files found.
cppa/detail/behavior_stack.hpp
View file @
425aa491
...
...
@@ -111,6 +111,7 @@ class behavior_stack
void
exec
(
Policy
&
policy
,
Client
*
client
)
{
while
(
!
empty
())
{
invoke
(
policy
,
client
,
client
->
receive_node
());
cleanup
();
}
}
...
...
cppa/detail/receive_policy.hpp
View file @
425aa491
...
...
@@ -282,8 +282,9 @@ class receive_policy {
}
template
<
class
Client
>
static
inline
void
hm_cleanup
(
Client
*
client
,
nestable
)
{
client
->
m_current_node
=
&
(
client
->
m_dummy_node
);
static
inline
void
hm_cleanup
(
Client
*
client
,
pointer
previous
,
nestable
)
{
client
->
m_current_node
->
marked
=
false
;
client
->
m_current_node
=
previous
;
}
template
<
class
Client
>
...
...
@@ -308,7 +309,7 @@ class receive_policy {
}
template
<
class
Client
>
static
inline
void
hm_cleanup
(
Client
*
client
,
sequential
)
{
static
inline
void
hm_cleanup
(
Client
*
client
,
pointer
/*previous*/
,
sequential
)
{
client
->
m_current_node
=
&
(
client
->
m_dummy_node
);
if
(
client
->
has_behavior
())
{
client
->
request_timeout
(
client
->
get_behavior
().
timeout
());
...
...
@@ -347,12 +348,11 @@ class receive_policy {
client
->
mark_arrived
(
awaited_response
);
client
->
remove_handler
(
awaited_response
);
}
hm_cleanup
(
client
,
policy
);
return
hm_msg_handled
;
}
case
sync_response
:
{
if
(
awaited_response
.
valid
()
&&
node
->
mid
==
awaited_response
)
{
hm_begin
(
client
,
node
,
policy
);
auto
previous_node
=
hm_begin
(
client
,
node
,
policy
);
# ifdef CPPA_DEBUG
if
(
!
fun
(
node
->
msg
))
{
std
::
cerr
<<
"WARNING: actor didn't handle a "
...
...
@@ -363,7 +363,7 @@ class receive_policy {
# endif
client
->
mark_arrived
(
awaited_response
);
client
->
remove_handler
(
awaited_response
);
hm_cleanup
(
client
,
policy
);
hm_cleanup
(
client
,
p
revious_node
,
p
olicy
);
return
hm_msg_handled
;
}
return
hm_cache_msg
;
...
...
@@ -381,7 +381,7 @@ class receive_policy {
id
.
response_id
(),
any_tuple
());
}
hm_cleanup
(
client
,
policy
);
hm_cleanup
(
client
,
p
revious_node
,
p
olicy
);
return
hm_msg_handled
;
}
// no match (restore client members)
...
...
cppa/detail/stacked_actor_mixin.hpp
View file @
425aa491
...
...
@@ -109,6 +109,8 @@ class stacked_actor_mixin : public Base {
}
void
become_impl
(
behavior
&&
bhvr
,
bool
discard_old
,
message_id_t
mid
)
{
dthis
()
->
reset_timeout
();
dthis
()
->
request_timeout
(
bhvr
.
timeout
());
if
(
m_bhvr_stack_ptr
)
{
if
(
discard_old
)
m_bhvr_stack_ptr
->
pop_async_back
();
m_bhvr_stack_ptr
->
push_back
(
std
::
move
(
bhvr
),
mid
);
...
...
cppa/thread_mapped_actor.hpp
View file @
425aa491
...
...
@@ -111,6 +111,10 @@ class thread_mapped_actor : public detail::stacked_actor_mixin<
inline
void
initialized
(
bool
value
)
{
m_initialized
=
value
;
}
// required by stacked_actor_mixin
inline
void
reset_timeout
()
{
}
inline
void
request_timeout
(
const
util
::
duration
&
)
{
}
protected:
bool
initialized
();
...
...
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