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
65fbdbbe
Commit
65fbdbbe
authored
Nov 15, 2014
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix namespaces
parent
00cbb5e7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
libcaf_core/caf/chrono.hpp
libcaf_core/caf/chrono.hpp
+1
-0
libcaf_core/caf/mutex.hpp
libcaf_core/caf/mutex.hpp
+1
-1
libcaf_core/caf/scheduler/coordinator.hpp
libcaf_core/caf/scheduler/coordinator.hpp
+4
-4
No files found.
libcaf_core/caf/chrono.hpp
View file @
65fbdbbe
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include <chrono>
#include <chrono>
#include <cstdio>
#include <cstdio>
#include <algorithm>
#ifdef __RIOTBUILD_FLAG
#ifdef __RIOTBUILD_FLAG
...
...
libcaf_core/caf/mutex.hpp
View file @
65fbdbbe
...
@@ -70,7 +70,7 @@ class lock_guard {
...
@@ -70,7 +70,7 @@ class lock_guard {
public:
public:
using
mutex_type
=
Mutex
;
using
mutex_type
=
Mutex
;
inline
explicit
lock_guard
(
mutex_type
&
mtx
)
:
m_mtx
{
mtx
}
{
m_mtx
.
lock
();
}
inline
explicit
lock_guard
(
mutex_type
&
mtx
)
:
m_mtx
(
mtx
)
{
m_mtx
.
lock
();
}
inline
lock_guard
(
mutex_type
&
mtx
,
adopt_lock_t
)
:
m_mtx
{
mtx
}
{}
inline
lock_guard
(
mutex_type
&
mtx
,
adopt_lock_t
)
:
m_mtx
{
mtx
}
{}
inline
~
lock_guard
()
{
m_mtx
.
unlock
();
}
inline
~
lock_guard
()
{
m_mtx
.
unlock
();
}
...
...
libcaf_core/caf/scheduler/coordinator.hpp
View file @
65fbdbbe
...
@@ -88,7 +88,7 @@ class coordinator : public abstract_coordinator {
...
@@ -88,7 +88,7 @@ class coordinator : public abstract_coordinator {
resumable
::
resume_result
resume
(
execution_unit
*
ptr
,
size_t
)
override
{
resumable
::
resume_result
resume
(
execution_unit
*
ptr
,
size_t
)
override
{
CAF_LOG_DEBUG
(
"shutdown_helper::resume => shutdown worker"
);
CAF_LOG_DEBUG
(
"shutdown_helper::resume => shutdown worker"
);
CAF_ASSERT
(
ptr
!=
nullptr
);
CAF_ASSERT
(
ptr
!=
nullptr
);
std
::
unique_lock
<
std
::
mutex
>
guard
(
mtx
);
nique_lock
<
mutex
>
guard
(
mtx
);
last_worker
=
ptr
;
last_worker
=
ptr
;
cv
.
notify_all
();
cv
.
notify_all
();
return
resumable
::
shutdown_execution_unit
;
return
resumable
::
shutdown_execution_unit
;
...
@@ -96,8 +96,8 @@ class coordinator : public abstract_coordinator {
...
@@ -96,8 +96,8 @@ class coordinator : public abstract_coordinator {
shutdown_helper
()
:
last_worker
(
nullptr
)
{
shutdown_helper
()
:
last_worker
(
nullptr
)
{
// nop
// nop
}
}
std
::
mutex
mtx
;
mutex
mtx
;
std
::
condition_variable
cv
;
condition_variable
cv
;
execution_unit
*
last_worker
;
execution_unit
*
last_worker
;
};
};
// use a set to keep track of remaining workers
// use a set to keep track of remaining workers
...
@@ -113,7 +113,7 @@ class coordinator : public abstract_coordinator {
...
@@ -113,7 +113,7 @@ class coordinator : public abstract_coordinator {
// since jobs can be stolen, we cannot assume that we have
// since jobs can be stolen, we cannot assume that we have
// actually shut down the worker we've enqueued sh to
// actually shut down the worker we've enqueued sh to
{
// lifetime scope of guard
{
// lifetime scope of guard
std
::
unique_lock
<
std
::
mutex
>
guard
(
sh
.
mtx
);
unique_lock
<
mutex
>
guard
(
sh
.
mtx
);
sh
.
cv
.
wait
(
guard
,
[
&
]
{
return
sh
.
last_worker
!=
nullptr
;
});
sh
.
cv
.
wait
(
guard
,
[
&
]
{
return
sh
.
last_worker
!=
nullptr
;
});
}
}
alive_workers
.
erase
(
static_cast
<
worker_type
*>
(
sh
.
last_worker
));
alive_workers
.
erase
(
static_cast
<
worker_type
*>
(
sh
.
last_worker
));
...
...
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