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
72e58355
Commit
72e58355
authored
Apr 13, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix shutdown behavior of actor pools
parent
b2291430
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
9 deletions
+22
-9
libcaf_core/caf/actor_pool.hpp
libcaf_core/caf/actor_pool.hpp
+3
-1
libcaf_core/caf/decorator/sequencer.hpp
libcaf_core/caf/decorator/sequencer.hpp
+1
-1
libcaf_core/caf/monitorable_actor.hpp
libcaf_core/caf/monitorable_actor.hpp
+1
-1
libcaf_core/src/actor_pool.cpp
libcaf_core/src/actor_pool.cpp
+13
-2
libcaf_core/src/local_actor.cpp
libcaf_core/src/local_actor.cpp
+1
-1
libcaf_core/src/monitorable_actor.cpp
libcaf_core/src/monitorable_actor.cpp
+2
-2
libcaf_core/src/sequencer.cpp
libcaf_core/src/sequencer.cpp
+1
-1
No files found.
libcaf_core/caf/actor_pool.hpp
View file @
72e58355
...
...
@@ -102,8 +102,10 @@ public:
actor_pool
(
actor_config
&
cfg
);
void
on_destroy
()
override
;
protected:
void
on_cleanup
()
override
;
void
on_cleanup
(
const
error
&
reason
)
override
;
private:
bool
filter
(
upgrade_lock
<
detail
::
shared_spinlock
>&
,
...
...
libcaf_core/caf/decorator/sequencer.hpp
View file @
72e58355
...
...
@@ -47,7 +47,7 @@ public:
message_types_set
message_types
()
const
override
;
protected:
void
on_cleanup
()
override
;
void
on_cleanup
(
const
error
&
reason
)
override
;
private:
strong_actor_ptr
f_
;
...
...
libcaf_core/caf/monitorable_actor.hpp
View file @
72e58355
...
...
@@ -104,7 +104,7 @@ protected:
/// Allows subclasses to add additional cleanup code to the
/// critical secion in `cleanup`. This member function is
/// called inside of a critical section.
virtual
void
on_cleanup
();
virtual
void
on_cleanup
(
const
error
&
reason
);
/// Sends a response message if `what` is a request.
void
bounce
(
mailbox_element_ptr
&
what
);
...
...
libcaf_core/src/actor_pool.cpp
View file @
72e58355
...
...
@@ -126,8 +126,19 @@ actor_pool::actor_pool(actor_config& cfg) : monitorable_actor(cfg) {
register_at_system
();
}
void
actor_pool
::
on_cleanup
()
{
// nop
void
actor_pool
::
on_destroy
()
{
CAF_PUSH_AID_FROM_PTR
(
this
);
if
(
!
getf
(
is_cleaned_up_flag
))
{
cleanup
(
exit_reason
::
unreachable
,
nullptr
);
monitorable_actor
::
on_destroy
();
unregister_from_system
();
}
}
void
actor_pool
::
on_cleanup
(
const
error
&
reason
)
{
CAF_PUSH_AID_FROM_PTR
(
this
);
CAF_IGNORE_UNUSED
(
reason
);
CAF_LOG_TERMINATE_EVENT
(
this
,
reason
);
}
bool
actor_pool
::
filter
(
upgrade_lock
<
detail
::
shared_spinlock
>&
guard
,
...
...
libcaf_core/src/local_actor.cpp
View file @
72e58355
...
...
@@ -119,9 +119,9 @@ bool local_actor::cleanup(error&& fail_state, execution_unit* host) {
CAF_LOG_TRACE
(
CAF_ARG
(
fail_state
));
// tell registry we're done
unregister_from_system
();
CAF_LOG_TERMINATE_EVENT
(
this
,
fail_state
);
monitorable_actor
::
cleanup
(
std
::
move
(
fail_state
),
host
);
clock
().
cancel_timeouts
(
this
);
CAF_LOG_TERMINATE_EVENT
(
this
,
fail_state
);
return
true
;
}
...
...
libcaf_core/src/monitorable_actor.cpp
View file @
72e58355
...
...
@@ -82,7 +82,7 @@ bool monitorable_actor::cleanup(error&& reason, execution_unit* host) {
fail_state_
=
std
::
move
(
reason
);
attachables_head_
.
swap
(
head
);
flags
(
flags
()
|
is_terminated_flag
|
is_cleaned_up_flag
);
on_cleanup
();
on_cleanup
(
fail_state_
);
return
true
;
}
return
false
;
...
...
@@ -104,7 +104,7 @@ bool monitorable_actor::cleanup(error&& reason, execution_unit* host) {
return
true
;
}
void
monitorable_actor
::
on_cleanup
()
{
void
monitorable_actor
::
on_cleanup
(
const
error
&
)
{
// nop
}
...
...
libcaf_core/src/sequencer.cpp
View file @
72e58355
...
...
@@ -76,7 +76,7 @@ sequencer::message_types_set sequencer::message_types() const {
return
msg_types_
;
}
void
sequencer
::
on_cleanup
()
{
void
sequencer
::
on_cleanup
(
const
error
&
)
{
f_
.
reset
();
g_
.
reset
();
}
...
...
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