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
484ad007
Commit
484ad007
authored
Apr 19, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
6048c9b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
src/abstract_event_based_actor.cpp
src/abstract_event_based_actor.cpp
+4
-2
src/yielding_actor.cpp
src/yielding_actor.cpp
+9
-10
No files found.
src/abstract_event_based_actor.cpp
View file @
484ad007
...
@@ -110,9 +110,10 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb)
...
@@ -110,9 +110,10 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb)
self
.
set
(
this
);
self
.
set
(
this
);
try
try
{
{
std
::
unique_ptr
<
detail
::
recursive_queue_node
>
e
;
for
(;;)
for
(;;)
{
{
std
::
unique_ptr
<
detail
::
recursive_queue_node
>
e
{
m_mailbox
.
try_pop
()}
;
e
.
reset
(
m_mailbox
.
try_pop
())
;
if
(
!
e
)
if
(
!
e
)
{
{
m_state
.
store
(
abstract_scheduled_actor
::
about_to_block
);
m_state
.
store
(
abstract_scheduled_actor
::
about_to_block
);
...
@@ -151,7 +152,7 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb)
...
@@ -151,7 +152,7 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb)
}
}
// try to match cached messages before receiving new ones
// try to match cached messages before receiving new ones
auto
i
=
m_cache
.
begin
();
auto
i
=
m_cache
.
begin
();
while
(
i
!=
m_cache
.
end
()
&&
!
m_loop_stack
.
empty
()
)
while
(
i
!=
m_cache
.
end
())
{
{
switch
(
handle_message
(
*
(
*
i
)))
switch
(
handle_message
(
*
(
*
i
)))
{
{
...
@@ -179,6 +180,7 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb)
...
@@ -179,6 +180,7 @@ void abstract_event_based_actor::resume(util::fiber*, scheduler::callback* cb)
default:
exit
(
7
);
// illegal state
default:
exit
(
7
);
// illegal state
}
}
}
}
break
;
}
}
case
cache_msg
:
case
cache_msg
:
{
{
...
...
src/yielding_actor.cpp
View file @
484ad007
...
@@ -91,16 +91,17 @@ void yielding_actor::dequeue(partial_function& fun)
...
@@ -91,16 +91,17 @@ void yielding_actor::dequeue(partial_function& fun)
{
{
if
(
m_invoke
.
invoke_from_cache
(
fun
)
==
false
)
if
(
m_invoke
.
invoke_from_cache
(
fun
)
==
false
)
{
{
for
(;;)
queue_node_ptr
e
;
do
{
{
queue_node_ptr
e
{
m_mailbox
.
try_pop
()}
;
e
.
reset
(
m_mailbox
.
try_pop
())
;
while
(
!
e
)
while
(
!
e
)
{
{
yield_until_not_empty
();
yield_until_not_empty
();
e
.
reset
(
m_mailbox
.
try_pop
());
e
.
reset
(
m_mailbox
.
try_pop
());
}
}
if
(
m_invoke
.
invoke
(
e
,
fun
))
return
;
}
}
while
(
!
m_invoke
.
invoke
(
e
,
fun
));
}
}
}
}
...
@@ -116,20 +117,18 @@ void yielding_actor::dequeue(behavior& bhvr)
...
@@ -116,20 +117,18 @@ void yielding_actor::dequeue(behavior& bhvr)
{
{
request_timeout
(
bhvr
.
timeout
());
request_timeout
(
bhvr
.
timeout
());
bool
timeout_occured
=
false
;
bool
timeout_occured
=
false
;
for
(;;)
queue_node_ptr
e
;
do
{
{
queue_node_ptr
e
{
m_mailbox
.
try_pop
()}
;
e
.
reset
(
m_mailbox
.
try_pop
())
;
while
(
!
e
)
while
(
!
e
)
{
{
yield_until_not_empty
();
yield_until_not_empty
();
e
.
reset
(
m_mailbox
.
try_pop
());
e
.
reset
(
m_mailbox
.
try_pop
());
}
}
if
(
m_invoke
.
invoke
(
e
,
fun
,
&
bhvr
,
&
timeout_occured
)
||
timeout_occured
)
{
return
;
}
}
}
while
(
!
m_invoke
.
invoke
(
e
,
fun
,
&
bhvr
,
&
timeout_occured
)
&&
!
timeout_occured
);
}
}
}
}
...
...
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