Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
14d69a31
Commit
14d69a31
authored
Jul 02, 2015
by
Thomas Köppe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean-up: Rename internal macros consistently.
parent
6059e8ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
atomic_counter.hpp
src/atomic_counter.hpp
+4
-4
atomic_ptr.hpp
src/atomic_ptr.hpp
+7
-7
No files found.
src/atomic_counter.hpp
View file @
14d69a31
...
...
@@ -36,7 +36,7 @@
#if defined ZMQ_FORCE_MUTEXES
#define ZMQ_ATOMIC_COUNTER_MUTEX
#elif defined ZMQ_HAVE_ATOMIC_INTRINSICS
#define ZMQ_ATOMIC_INTRINSIC
#define ZMQ_ATOMIC_
COUNTER_
INTRINSIC
#elif (defined ZMQ_CXX11 && defined __cplusplus && __cplusplus >= 201103L)
#define ZMQ_ATOMIC_COUNTER_CXX11
#elif (defined __i386__ || defined __x86_64__) && defined __GNUC__
...
...
@@ -99,7 +99,7 @@ namespace zmq
#if defined ZMQ_ATOMIC_COUNTER_WINDOWS
old_value
=
InterlockedExchangeAdd
((
LONG
*
)
&
value
,
increment_
);
#elif defined ZMQ_ATOMIC_INTRINSIC
#elif defined ZMQ_ATOMIC_
COUNTER_
INTRINSIC
old_value
=
__atomic_fetch_add
(
&
value
,
increment_
,
__ATOMIC_ACQ_REL
);
#elif defined ZMQ_ATOMIC_COUNTER_CXX11
old_value
=
value
.
fetch_add
(
increment_
,
std
::
memory_order_acq_rel
);
...
...
@@ -145,7 +145,7 @@ namespace zmq
LONG
delta
=
-
((
LONG
)
decrement
);
integer_t
old
=
InterlockedExchangeAdd
((
LONG
*
)
&
value
,
delta
);
return
old
-
decrement
!=
0
;
#elif defined ZMQ_ATOMIC_INTRINSIC
#elif defined ZMQ_ATOMIC_
COUNTER_
INTRINSIC
integer_t
nv
=
__atomic_sub_fetch
(
&
value
,
decrement
,
__ATOMIC_ACQ_REL
);
return
nv
!=
0
;
#elif defined ZMQ_ATOMIC_COUNTER_CXX11
...
...
@@ -219,7 +219,7 @@ namespace zmq
// Remove macros local to this file.
#undef ZMQ_ATOMIC_COUNTER_MUTEX
#undef ZMQ_ATOMIC_INTRINSIC
#undef ZMQ_ATOMIC_
COUNTER_
INTRINSIC
#undef ZMQ_ATOMIC_COUNTER_CXX11
#undef ZMQ_ATOMIC_COUNTER_X86
#undef ZMQ_ATOMIC_COUNTER_ARM
...
...
src/atomic_ptr.hpp
View file @
14d69a31
...
...
@@ -37,7 +37,7 @@
#elif defined ZMQ_HAVE_ATOMIC_INTRINSICS
#define ZMQ_ATOMIC_PTR_INTRINSIC
#elif (defined ZMQ_CXX11 && defined __cplusplus && __cplusplus >= 201103L)
#define ZMQ_ATOMIC_CXX11
#define ZMQ_ATOMIC_
PTR_
CXX11
#elif (defined __i386__ || defined __x86_64__) && defined __GNUC__
#define ZMQ_ATOMIC_PTR_X86
#elif defined __ARM_ARCH_7A__ && defined __GNUC__
...
...
@@ -54,7 +54,7 @@
#if defined ZMQ_ATOMIC_PTR_MUTEX
#include "mutex.hpp"
#elif defined ZMQ_ATOMIC_CXX11
#elif defined ZMQ_ATOMIC_
PTR_
CXX11
#include <atomic>
#elif defined ZMQ_ATOMIC_PTR_WINDOWS
#include "windows.hpp"
...
...
@@ -100,7 +100,7 @@ namespace zmq
return
(
T
*
)
InterlockedExchangePointer
((
PVOID
*
)
&
ptr
,
val_
);
#elif defined ZMQ_ATOMIC_PTR_INTRINSIC
return
(
T
*
)
__atomic_exchange_n
(
&
ptr
,
val_
,
__ATOMIC_ACQ_REL
);
#elif defined ZMQ_ATOMIC_CXX11
#elif defined ZMQ_ATOMIC_
PTR_
CXX11
return
ptr
.
exchange
(
val_
,
std
::
memory_order_acq_rel
);
#elif defined ZMQ_ATOMIC_PTR_ATOMIC_H
return
(
T
*
)
atomic_swap_ptr
(
&
ptr
,
val_
);
...
...
@@ -152,7 +152,7 @@ namespace zmq
__atomic_compare_exchange_n
(
&
ptr
,
(
volatile
T
**
)
&
old
,
val_
,
false
,
__ATOMIC_RELEASE
,
__ATOMIC_ACQUIRE
);
return
old
;
#elif defined ZMQ_ATOMIC_CXX11
#elif defined ZMQ_ATOMIC_
PTR_
CXX11
ptr
.
compare_exchange_strong
(
cmp_
,
val_
,
std
::
memory_order_acq_rel
);
return
cmp_
;
#elif defined ZMQ_ATOMIC_PTR_ATOMIC_H
...
...
@@ -198,7 +198,7 @@ namespace zmq
private
:
#if defined ZMQ_ATOMIC_CXX11
#if defined ZMQ_ATOMIC_
PTR_
CXX11
std
::
atomic
<
T
*>
ptr
;
#else
volatile
T
*
ptr
;
...
...
@@ -208,7 +208,7 @@ namespace zmq
mutex_t
sync
;
#endif
#if ! defined ZMQ_ATOMIC_CXX11
#if ! defined ZMQ_ATOMIC_
PTR_
CXX11
atomic_ptr_t
(
const
atomic_ptr_t
&
);
const
atomic_ptr_t
&
operator
=
(
const
atomic_ptr_t
&
);
#endif
...
...
@@ -219,7 +219,7 @@ namespace zmq
// Remove macros local to this file.
#undef ZMQ_ATOMIC_PTR_MUTEX
#undef ZMQ_ATOMIC_PTR_INTRINSIC
#undef ZMQ_ATOMIC_CXX11
#undef ZMQ_ATOMIC_
PTR_
CXX11
#undef ZMQ_ATOMIC_PTR_X86
#undef ZMQ_ATOMIC_PTR_ARM
#undef ZMQ_ATOMIC_PTR_TILE
...
...
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