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
655ea2fd
Commit
655ea2fd
authored
Nov 09, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix timeout handling in blocking_actor, close #521
parent
a6b7d52c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
libcaf_core/src/blocking_actor.cpp
libcaf_core/src/blocking_actor.cpp
+2
-2
libcaf_core/test/blocking_actor.cpp
libcaf_core/test/blocking_actor.cpp
+11
-0
No files found.
libcaf_core/src/blocking_actor.cpp
View file @
655ea2fd
...
...
@@ -320,7 +320,7 @@ void blocking_actor::receive_impl(receive_cond& rcc,
// reset the timeout each iteration
if
(
!
seq
.
await_value
(
true
))
{
// short-circuit "loop body"
bhvr
.
nested
.
handle_timeout
();
bhvr
.
handle_timeout
();
if
(
!
rcc
.
post
())
return
;
continue
;
...
...
@@ -379,7 +379,7 @@ void blocking_actor::receive_impl(receive_cond& rcc,
}
}
while
(
skipped
&&
!
timed_out
);
if
(
timed_out
)
bhvr
.
nested
.
handle_timeout
();
bhvr
.
handle_timeout
();
else
seq
.
erase_and_advance
();
// check loop post condition
...
...
libcaf_core/test/blocking_actor.cpp
View file @
655ea2fd
...
...
@@ -70,4 +70,15 @@ CAF_TEST(behavior_ref) {
self
->
receive
(
bhvr
);
}
CAF_TEST
(
timeout_in_scoped_actor
)
{
bool
timeout_called
=
false
;
scoped_actor
self
{
system
};
self
->
receive
(
after
(
std
::
chrono
::
milliseconds
(
20
))
>>
[
&
]
{
timeout_called
=
true
;
}
);
CAF_CHECK
(
timeout_called
);
}
CAF_TEST_FIXTURE_SCOPE_END
()
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