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
46d4d607
authored
8 years ago
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linux fixes
parent
965cefbd
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
10 deletions
+16
-10
base_c/include/embb/base/c/atomic.h
+7
-2
base_c/include/embb/base/c/internal/atomic/destroy.h
+1
-0
base_cpp/include/embb/base/internal/atomic/atomic_arithmetic.h
+2
-2
base_cpp/include/embb/base/internal/atomic/atomic_integer.h
+6
-6
No files found.
base_c/include/embb/base/c/atomic.h
View file @
46d4d607
...
...
@@ -293,7 +293,9 @@ extern "C" {
#endif
#include <embb/base/c/internal/cmake_config.h>
#ifdef EMBB_THREADING_ANALYSIS_MODE
#include <embb/base/c/internal/platform.h>
#include <assert.h>
...
...
@@ -322,8 +324,11 @@ void embb_mutex_destroy(
#else
#define EMBB_ATOMIC_MUTEX_LOCK(mutex)
#define EMBB_ATOMIC_MUTEX_UNLOCK(mutex)
#define EMBB_ATOMIC_MUTEX_INIT(...)
#define EMBB_ATOMIC_MUTEX_LOCK(...)
#define EMBB_ATOMIC_MUTEX_UNLOCK(...)
#define EMBB_ATOMIC_MUTEX_DESTROY(...)
#define EMBB_ATOMIC_INIT_CHECK(...)
#endif
...
...
This diff is collapsed.
Click to expand it.
base_c/include/embb/base/c/internal/atomic/destroy.h
View file @
46d4d607
...
...
@@ -42,6 +42,7 @@
#define EMBB_ATOMIC_INTERNAL_DEFINE_DESTROY_METHOD(EMBB_ATOMIC_PARAMETER_TYPE_NATIVE, EMBB_ATOMIC_PARAMETER_ATOMIC_TYPE_SUFFIX, EMBB_ATOMIC_PARAMETER_TYPE_SIZE) \
EMBB_PLATFORM_INLINE void EMBB_CAT2(embb_atomic_destroy_, EMBB_ATOMIC_PARAMETER_ATOMIC_TYPE_SUFFIX)(\
EMBB_CAT2(embb_atomic_, EMBB_ATOMIC_PARAMETER_ATOMIC_TYPE_SUFFIX)* variable) { \
(void)variable; \
EMBB_ATOMIC_INIT_CHECK(variable); \
EMBB_ATOMIC_MUTEX_DESTROY(variable->internal_mutex); \
}
...
...
This diff is collapsed.
Click to expand it.
base_cpp/include/embb/base/internal/atomic/atomic_arithmetic.h
View file @
46d4d607
...
...
@@ -117,10 +117,10 @@ FetchAndAdd(DifferenceType val) {
NativeType
native_desired
;
memcpy
(
&
native_desired
,
&
desired
,
sizeof
(
desired
));
EMBB_ATOMIC_MUTEX_LOCK
(
internal_mutex
);
EMBB_ATOMIC_MUTEX_LOCK
(
this
->
internal_mutex
);
NativeType
storage_value
=
fetch_and_add_implementation
<
NativeType
>::
fetch_and_add
(
&
this
->
AtomicValue
,
native_desired
);
EMBB_ATOMIC_MUTEX_UNLOCK
(
internal_mutex
);
EMBB_ATOMIC_MUTEX_UNLOCK
(
this
->
internal_mutex
);
memcpy
(
&
return_value
,
&
storage_value
,
sizeof
(
return_value
));
return
return_value
;
...
...
This diff is collapsed.
Click to expand it.
base_cpp/include/embb/base/internal/atomic/atomic_integer.h
View file @
46d4d607
...
...
@@ -93,10 +93,10 @@ inline void AtomicInteger<BaseType>::operator&=(BaseType val) {
NativeType
native_operand
;
memcpy
(
&
native_operand
,
&
val
,
sizeof
(
val
));
EMBB_ATOMIC_MUTEX_LOCK
(
internal_mutex
);
EMBB_ATOMIC_MUTEX_LOCK
(
this
->
internal_mutex
);
and_assign_implementation
<
NativeType
>::
and_assign
(
&
this
->
AtomicValue
,
native_operand
);
EMBB_ATOMIC_MUTEX_UNLOCK
(
internal_mutex
);
EMBB_ATOMIC_MUTEX_UNLOCK
(
this
->
internal_mutex
);
}
template
<
typename
BaseType
>
...
...
@@ -104,10 +104,10 @@ inline void AtomicInteger<BaseType>::operator|=(BaseType val) {
NativeType
native_operand
;
memcpy
(
&
native_operand
,
&
val
,
sizeof
(
val
));
EMBB_ATOMIC_MUTEX_LOCK
(
internal_mutex
);
EMBB_ATOMIC_MUTEX_LOCK
(
this
->
internal_mutex
);
or_assign_implementation
<
NativeType
>::
or_assign
(
&
this
->
AtomicValue
,
native_operand
);
EMBB_ATOMIC_MUTEX_UNLOCK
(
internal_mutex
);
EMBB_ATOMIC_MUTEX_UNLOCK
(
this
->
internal_mutex
);
}
template
<
typename
BaseType
>
...
...
@@ -115,10 +115,10 @@ inline void AtomicInteger<BaseType>::operator^=(BaseType val) {
NativeType
native_operand
;
memcpy
(
&
native_operand
,
&
val
,
sizeof
(
val
));
EMBB_ATOMIC_MUTEX_LOCK
(
internal_mutex
);
EMBB_ATOMIC_MUTEX_LOCK
(
this
->
internal_mutex
);
xor_assign_implementation
<
NativeType
>::
xor_assign
(
&
this
->
AtomicValue
,
native_operand
);
EMBB_ATOMIC_MUTEX_UNLOCK
(
internal_mutex
);
EMBB_ATOMIC_MUTEX_UNLOCK
(
this
->
internal_mutex
);
}
}
// namespace atomic
...
...
This diff is collapsed.
Click to expand it.
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