Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
696bc68d
authored
Nov 04, 2016
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base_cpp: readded const in atomic implementation and made internal mutex const
parent
a7c7b027
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
base_cpp/include/embb/base/internal/atomic/atomic_base.h
+5
-5
base_cpp/include/embb/base/internal/atomic/atomic_pointer.h
+4
-4
No files found.
base_cpp/include/embb/base/internal/atomic/atomic_base.h
View file @
696bc68d
...
...
@@ -59,7 +59,7 @@ class AtomicBase {
mutable
NativeType
AtomicValue
;
#ifdef EMBB_THREADING_ANALYSIS_MODE
embb_mutex_t
internal_mutex
;
mutable
embb_mutex_t
internal_mutex
;
#endif
public
:
...
...
@@ -84,13 +84,13 @@ class AtomicBase {
// The members below are documented in atomic.h
BaseType
operator
=
(
BaseType
val
);
operator
BaseType
();
operator
BaseType
()
const
;
bool
IsLockFree
()
const
;
bool
IsArithmetic
()
const
;
bool
IsInteger
()
const
;
bool
IsPointer
()
const
;
void
Store
(
BaseType
val
);
BaseType
Load
();
BaseType
Load
()
const
;
BaseType
Swap
(
BaseType
val
);
bool
CompareAndSwap
(
BaseType
&
expected
,
BaseType
desired
);
};
...
...
@@ -118,7 +118,7 @@ inline BaseType AtomicBase<BaseType>::operator=(BaseType val) {
}
template
<
typename
BaseType
>
inline
AtomicBase
<
BaseType
>::
operator
BaseType
()
{
inline
AtomicBase
<
BaseType
>::
operator
BaseType
()
const
{
return
Load
();
}
...
...
@@ -155,7 +155,7 @@ inline void AtomicBase<BaseType>::Store(BaseType val) {
}
template
<
typename
BaseType
>
inline
BaseType
AtomicBase
<
BaseType
>::
Load
()
{
inline
BaseType
AtomicBase
<
BaseType
>::
Load
()
const
{
BaseType
return_value
;
EMBB_ATOMIC_MUTEX_LOCK
(
internal_mutex
);
...
...
base_cpp/include/embb/base/internal/atomic/atomic_pointer.h
View file @
696bc68d
...
...
@@ -65,8 +65,8 @@ class AtomicPointer : public AtomicArithmetic<BaseType*, DifferenceType, S> {
bool
IsPointer
()
const
;
// The methods below are documented in atomic.h
BaseType
*
operator
->
();
BaseType
&
operator
*
();
BaseType
*
operator
->
()
const
;
BaseType
&
operator
*
()
const
;
};
template
<
typename
BaseType
,
typename
DifferenceType
,
size_t
S
>
...
...
@@ -93,13 +93,13 @@ inline bool AtomicPointer<BaseType, DifferenceType, S>::
template
<
typename
BaseType
,
typename
DifferenceType
,
size_t
S
>
inline
BaseType
*
AtomicPointer
<
BaseType
,
DifferenceType
,
S
>::
operator
->
()
{
operator
->
()
const
{
return
this
->
Load
();
}
template
<
typename
BaseType
,
typename
DifferenceType
,
size_t
S
>
inline
BaseType
&
AtomicPointer
<
BaseType
,
DifferenceType
,
S
>::
operator
*
()
{
operator
*
()
const
{
return
*
(
this
->
Load
());
}
...
...
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