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
9ede3f3a
Commit
9ede3f3a
authored
Jul 15, 2014
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix shutdown of scheduler helpers
parent
8d4e2e0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
17 deletions
+25
-17
src/scheduler.cpp
src/scheduler.cpp
+25
-17
No files found.
src/scheduler.cpp
View file @
9ede3f3a
...
...
@@ -106,19 +106,21 @@ class timer_actor final : public detail::proper_actor<blocking_actor,
auto
tout
=
hrc
::
now
();
std
::
multimap
<
decltype
(
tout
),
delayed_msg
>
messages
;
// message handling rules
auto
mfun
=
(
on
(
atom
(
"_Send"
),
arg_match
)
>>
[
&
](
const
duration
&
d
,
actor_addr
&
from
,
channel
&
to
,
message_id
mid
,
message
&
tup
)
{
insert_dmsg
(
messages
,
d
,
std
::
move
(
from
),
std
::
move
(
to
),
mid
,
std
::
move
(
tup
));
},
on
(
atom
(
"DIE"
))
>>
[
&
]
{
done
=
true
;
},
others
()
>>
[
&
]
{
# ifdef CPPA_DEBUG_MODE
std
::
cerr
<<
"coordinator::timer_loop: UNKNOWN MESSAGE: "
<<
to_string
(
msg_ptr
->
msg
)
<<
std
::
endl
;
# endif
});
message_handler
mfun
{
on
(
atom
(
"_Send"
),
arg_match
)
>>
[
&
](
const
duration
&
d
,
actor_addr
&
from
,
channel
&
to
,
message_id
mid
,
message
&
tup
)
{
insert_dmsg
(
messages
,
d
,
std
::
move
(
from
),
std
::
move
(
to
),
mid
,
std
::
move
(
tup
));
},
[
&
](
const
exit_msg
&
)
{
done
=
true
;
},
others
()
>>
[
&
]
{
std
::
cerr
<<
"coordinator::timer_loop: UNKNOWN MESSAGE: "
<<
to_string
(
msg_ptr
->
msg
)
<<
std
::
endl
;
}
};
// loop
while
(
!
done
)
{
while
(
!
msg_ptr
)
{
...
...
@@ -147,6 +149,7 @@ class timer_actor final : public detail::proper_actor<blocking_actor,
};
void
printer_loop
(
blocking_actor
*
self
)
{
self
->
trap_exit
(
true
);
std
::
map
<
actor_addr
,
std
::
string
>
out
;
auto
flush_output
=
[
&
out
](
const
actor_addr
&
s
)
{
auto
i
=
out
.
find
(
s
);
...
...
@@ -189,10 +192,15 @@ void printer_loop(blocking_actor* self) {
flush_output
(
dm
.
source
);
out
.
erase
(
dm
.
source
);
},
on
(
atom
(
"DIE"
))
>>
[
&
]
{
running
=
false
;
},
others
()
>>
[
self
]
{
std
::
cerr
<<
"*** unexpected: "
<<
to_string
(
self
->
last_dequeued
())
[
&
](
const
exit_msg
&
)
{
running
=
false
;
},
others
()
>>
[
self
]
{
std
::
cerr
<<
"*** unexpected: "
<<
to_string
(
self
->
last_dequeued
())
<<
std
::
endl
;
});
}
);
}
}
// namespace <anonymous>
...
...
@@ -273,7 +281,7 @@ void abstract_coordinator::stop() {
alive_workers
.
erase
(
i
);
}
// shutdown utility actors
CPPA_LOG_DEBUG
(
"send
'DIE'
messages to timer & printer"
);
CPPA_LOG_DEBUG
(
"send
exit
messages to timer & printer"
);
anon_send_exit
(
m_timer
->
address
(),
exit_reason
::
user_shutdown
);
anon_send_exit
(
m_printer
->
address
(),
exit_reason
::
user_shutdown
);
CPPA_LOG_DEBUG
(
"join threads of utility actors"
);
...
...
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