Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
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
protobuf
Commits
93a4fa23
Commit
93a4fa23
authored
Nov 02, 2016
by
Jisi Liu
Committed by
GitHub
Nov 02, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2302 from jbrianceau/generic-gcc-atomics-strong-cmpxchg
generic atomicops: Use strong compare_exchange
parents
750b9e24
a5a2c1d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
atomicops_internals_generic_gcc.h
src/google/protobuf/stubs/atomicops_internals_generic_gcc.h
+5
-5
No files found.
src/google/protobuf/stubs/atomicops_internals_generic_gcc.h
View file @
93a4fa23
...
...
@@ -38,7 +38,7 @@ namespace internal {
inline
Atomic32
NoBarrier_CompareAndSwap
(
volatile
Atomic32
*
ptr
,
Atomic32
old_value
,
Atomic32
new_value
)
{
__atomic_compare_exchange_n
(
ptr
,
&
old_value
,
new_value
,
tru
e
,
__atomic_compare_exchange_n
(
ptr
,
&
old_value
,
new_value
,
fals
e
,
__ATOMIC_RELAXED
,
__ATOMIC_RELAXED
);
return
old_value
;
}
...
...
@@ -61,7 +61,7 @@ inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
inline
Atomic32
Acquire_CompareAndSwap
(
volatile
Atomic32
*
ptr
,
Atomic32
old_value
,
Atomic32
new_value
)
{
__atomic_compare_exchange_n
(
ptr
,
&
old_value
,
new_value
,
tru
e
,
__atomic_compare_exchange_n
(
ptr
,
&
old_value
,
new_value
,
fals
e
,
__ATOMIC_ACQUIRE
,
__ATOMIC_ACQUIRE
);
return
old_value
;
}
...
...
@@ -69,7 +69,7 @@ inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
inline
Atomic32
Release_CompareAndSwap
(
volatile
Atomic32
*
ptr
,
Atomic32
old_value
,
Atomic32
new_value
)
{
__atomic_compare_exchange_n
(
ptr
,
&
old_value
,
new_value
,
tru
e
,
__atomic_compare_exchange_n
(
ptr
,
&
old_value
,
new_value
,
fals
e
,
__ATOMIC_RELEASE
,
__ATOMIC_ACQUIRE
);
return
old_value
;
}
...
...
@@ -115,7 +115,7 @@ inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
inline
Atomic64
Acquire_CompareAndSwap
(
volatile
Atomic64
*
ptr
,
Atomic64
old_value
,
Atomic64
new_value
)
{
__atomic_compare_exchange_n
(
ptr
,
&
old_value
,
new_value
,
tru
e
,
__atomic_compare_exchange_n
(
ptr
,
&
old_value
,
new_value
,
fals
e
,
__ATOMIC_ACQUIRE
,
__ATOMIC_ACQUIRE
);
return
old_value
;
}
...
...
@@ -123,7 +123,7 @@ inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
inline
Atomic64
NoBarrier_CompareAndSwap
(
volatile
Atomic64
*
ptr
,
Atomic64
old_value
,
Atomic64
new_value
)
{
__atomic_compare_exchange_n
(
ptr
,
&
old_value
,
new_value
,
tru
e
,
__atomic_compare_exchange_n
(
ptr
,
&
old_value
,
new_value
,
fals
e
,
__ATOMIC_RELAXED
,
__ATOMIC_RELAXED
);
return
old_value
;
}
...
...
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