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
709b793f
Commit
709b793f
authored
Jul 19, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix behavior of `trigger(x, 0)`
parent
4500d0ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
libcaf_io/caf/io/abstract_broker.hpp
libcaf_io/caf/io/abstract_broker.hpp
+10
-5
libcaf_io/caf/io/broker_servant.hpp
libcaf_io/caf/io/broker_servant.hpp
+4
-0
No files found.
libcaf_io/caf/io/abstract_broker.hpp
View file @
709b793f
...
...
@@ -122,13 +122,18 @@ public:
/// Allows `num_events` activities on `hdl`.
template
<
class
Handle
>
void
trigger
(
Handle
hdl
,
size_t
num_events
)
{
if
(
num_events
>
0
)
{
auto
ref
=
by_id
(
hdl
);
if
(
ref
)
ref
->
trigger
(
num_events
);
auto
ref
=
by_id
(
hdl
);
if
(
!
ref
)
return
;
if
(
num_events
>
0
)
{
ref
->
trigger
(
num_events
);
}
else
{
// if we have any number of activity tokens, ignore this call
// otherwise (currently in unconditional receive state) halt
auto
x
=
ref
->
activity_tokens
();
if
(
!
x
)
ref
->
halt
();
}
halt
(
hdl
);
}
/// Modifies the receive policy for given connection.
...
...
libcaf_io/caf/io/broker_servant.hpp
View file @
709b793f
...
...
@@ -65,6 +65,10 @@ public:
this
->
add_to_loop
();
}
inline
optional
<
size_t
>
activity_tokens
()
const
{
return
activity_tokens_
;
}
protected:
void
detach_from
(
abstract_broker
*
ptr
)
override
{
ptr
->
erase
(
hdl_
);
...
...
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