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
2f727c34
Commit
2f727c34
authored
May 09, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ufownl-topic/add-kill-exit-reason' into develop
parents
90a18f93
16a1f99c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
8 deletions
+20
-8
libcaf_core/caf/exit_reason.hpp
libcaf_core/caf/exit_reason.hpp
+5
-0
libcaf_core/src/exit_reason.cpp
libcaf_core/src/exit_reason.cpp
+1
-0
libcaf_core/src/local_actor.cpp
libcaf_core/src/local_actor.cpp
+14
-8
No files found.
libcaf_core/caf/exit_reason.hpp
View file @
2f727c34
...
@@ -66,6 +66,11 @@ static constexpr uint32_t out_of_workers = 0x00007;
...
@@ -66,6 +66,11 @@ static constexpr uint32_t out_of_workers = 0x00007;
*/
*/
static
constexpr
uint32_t
user_shutdown
=
0x00010
;
static
constexpr
uint32_t
user_shutdown
=
0x00010
;
/**
* Indicates that the actor was killed unconditionally.
*/
static
constexpr
uint32_t
kill
=
0x00011
;
/**
/**
* Indicates that an actor finishied execution because a connection
* Indicates that an actor finishied execution because a connection
* to a remote link was closed unexpectedly.
* to a remote link was closed unexpectedly.
...
...
libcaf_core/src/exit_reason.cpp
View file @
2f727c34
...
@@ -40,6 +40,7 @@ const char* as_string(uint32_t value) {
...
@@ -40,6 +40,7 @@ const char* as_string(uint32_t value) {
}
}
switch
(
value
)
{
switch
(
value
)
{
case
user_shutdown
:
return
"user_shutdown"
;
case
user_shutdown
:
return
"user_shutdown"
;
case
kill
:
return
"kill"
;
case
remote_link_unreachable
:
return
"remote_link_unreachable"
;
case
remote_link_unreachable
:
return
"remote_link_unreachable"
;
default:
default:
if
(
value
<
user_defined
)
{
if
(
value
<
user_defined
)
{
...
...
libcaf_core/src/local_actor.cpp
View file @
2f727c34
...
@@ -219,6 +219,10 @@ msg_type filter_msg(local_actor* self, mailbox_element& node) {
...
@@ -219,6 +219,10 @@ msg_type filter_msg(local_actor* self, mailbox_element& node) {
CAF_ASSERT
(
!
mid
.
valid
());
CAF_ASSERT
(
!
mid
.
valid
());
// make sure to get rid of attachables if they're no longer needed
// make sure to get rid of attachables if they're no longer needed
self
->
unlink_from
(
em
.
source
);
self
->
unlink_from
(
em
.
source
);
if
(
em
.
reason
==
exit_reason
::
kill
)
{
self
->
quit
(
em
.
reason
);
return
msg_type
::
non_normal_exit
;
}
if
(
self
->
trap_exit
()
==
false
)
{
if
(
self
->
trap_exit
()
==
false
)
{
if
(
em
.
reason
!=
exit_reason
::
normal
)
{
if
(
em
.
reason
!=
exit_reason
::
normal
)
{
self
->
quit
(
em
.
reason
);
self
->
quit
(
em
.
reason
);
...
@@ -583,16 +587,18 @@ resumable::resume_result local_actor::resume(execution_unit* eu,
...
@@ -583,16 +587,18 @@ resumable::resume_result local_actor::resume(execution_unit* eu,
bhvr_stack
().
clear
();
bhvr_stack
().
clear
();
bhvr_stack
().
cleanup
();
bhvr_stack
().
cleanup
();
on_exit
();
on_exit
();
auto
rsn
=
planned_exit_reason
();
if
(
rsn
!=
exit_reason
::
kill
)
{
if
(
has_behavior
())
{
if
(
has_behavior
())
{
CAF_LOG_DEBUG
(
"on_exit did set a new behavior"
);
CAF_LOG_DEBUG
(
"on_exit did set a new behavior"
);
planned_exit_reason
(
exit_reason
::
not_exited
);
planned_exit_reason
(
exit_reason
::
not_exited
);
return
false
;
// on_exit did set a new behavior
return
false
;
// on_exit did set a new behavior
}
}
auto
rsn
=
planned_exit_reason
();
if
(
rsn
==
exit_reason
::
not_exited
)
{
if
(
rsn
==
exit_reason
::
not_exited
)
{
rsn
=
exit_reason
::
normal
;
rsn
=
exit_reason
::
normal
;
planned_exit_reason
(
rsn
);
planned_exit_reason
(
rsn
);
}
}
}
cleanup
(
rsn
);
cleanup
(
rsn
);
return
true
;
return
true
;
};
};
...
...
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