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
2d9a9802
Commit
2d9a9802
authored
Mar 20, 2014
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved assignment of last_worker into crit. section
parent
8d9c4afe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
src/scheduler.cpp
src/scheduler.cpp
+8
-5
No files found.
src/scheduler.cpp
View file @
2d9a9802
...
@@ -241,21 +241,27 @@ class coordinator::shutdown_helper : public resumable {
...
@@ -241,21 +241,27 @@ class coordinator::shutdown_helper : public resumable {
resumable
::
resume_result
resume
(
detail
::
cs_thread
*
,
execution_unit
*
ptr
)
{
resumable
::
resume_result
resume
(
detail
::
cs_thread
*
,
execution_unit
*
ptr
)
{
CPPA_LOG_DEBUG
(
"shutdown_helper::resume => shutdown worker"
);
CPPA_LOG_DEBUG
(
"shutdown_helper::resume => shutdown worker"
);
last_worke
r
=
dynamic_cast
<
worker
*>
(
ptr
);
auto
wpt
r
=
dynamic_cast
<
worker
*>
(
ptr
);
CPPA_REQUIRE
(
last_worke
r
!=
nullptr
);
CPPA_REQUIRE
(
wpt
r
!=
nullptr
);
std
::
unique_lock
<
std
::
mutex
>
guard
(
mtx
);
std
::
unique_lock
<
std
::
mutex
>
guard
(
mtx
);
last_worker
=
wptr
;
cv
.
notify_all
();
cv
.
notify_all
();
return
resumable
::
shutdown_execution_unit
;
return
resumable
::
shutdown_execution_unit
;
}
}
shutdown_helper
()
:
last_worker
(
nullptr
)
{
}
shutdown_helper
()
:
last_worker
(
nullptr
)
{
}
~
shutdown_helper
();
std
::
mutex
mtx
;
std
::
mutex
mtx
;
std
::
condition_variable
cv
;
std
::
condition_variable
cv
;
worker
*
last_worker
;
worker
*
last_worker
;
};
};
// get rid of weak-vtables warning by providing dtor out-of-line
coordinator
::
shutdown_helper
::~
shutdown_helper
()
{
}
void
coordinator
::
initialize
()
{
void
coordinator
::
initialize
()
{
// launch threads of utility actors
// launch threads of utility actors
auto
ptr
=
m_timer
.
get
();
auto
ptr
=
m_timer
.
get
();
...
@@ -457,9 +463,6 @@ void worker::run() {
...
@@ -457,9 +463,6 @@ void worker::run() {
m_job_list
.
clear
();
m_job_list
.
clear
();
return
;
return
;
}
}
default:
{
CPPA_CRITICAL
(
"job->resume returned illegal result"
);
}
}
}
job
=
nullptr
;
job
=
nullptr
;
// give others the opportunity to steal from us
// give others the opportunity to steal from us
...
...
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