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
c44db8a4
Commit
c44db8a4
authored
Jan 05, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid false positives in actor lifetime test
parent
2a3e00c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
unit_testing/test_actor_lifetime.cpp
unit_testing/test_actor_lifetime.cpp
+6
-2
No files found.
unit_testing/test_actor_lifetime.cpp
View file @
c44db8a4
...
@@ -49,9 +49,13 @@ behavior tester(event_based_actor* self, const actor& aut) {
...
@@ -49,9 +49,13 @@ behavior tester(event_based_actor* self, const actor& aut) {
CAF_CHECKPOINT
();
CAF_CHECKPOINT
();
return
{
return
{
[
self
](
const
ExitMsgType
&
)
{
[
self
](
const
ExitMsgType
&
)
{
// must
not been destroyed here
// must
be still alive at this point
CAF_CHECK_EQUAL
(
s_testees
.
load
(),
1
);
CAF_CHECK_EQUAL
(
s_testees
.
load
(),
1
);
self
->
send
(
self
,
atom
(
"check"
));
// testee might be still running its cleanup code in
// another worker thread; by waiting some milliseconds, we make sure
// testee had enough time to return control to the scheduler
// which in turn destroys it by dropping the last remaining reference
self
->
delayed_send
(
self
,
std
::
chrono
::
milliseconds
(
30
),
atom
(
"check"
));
},
},
on
(
atom
(
"check"
))
>>
[
self
]
{
on
(
atom
(
"check"
))
>>
[
self
]
{
// make sure dude's dtor has been called
// make sure dude's dtor has been called
...
...
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