Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/databases/db5/files/patch-src_dbinc_atomic.h
16461 views
1
--- src/dbinc/atomic.h.orig 2013-09-09 15:35:08 UTC
2
+++ src/dbinc/atomic.h
3
@@ -70,7 +70,7 @@ typedef struct {
4
* These have no memory barriers; the caller must include them when necessary.
5
*/
6
#define atomic_read(p) ((p)->value)
7
-#define atomic_init(p, val) ((p)->value = (val))
8
+#define db_atomic_init(p, val) ((p)->value = (val))
9
10
#ifdef HAVE_ATOMIC_SUPPORT
11
12
@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val;
13
#define atomic_inc(env, p) __atomic_inc(p)
14
#define atomic_dec(env, p) __atomic_dec(p)
15
#define atomic_compare_exchange(env, p, o, n) \
16
- __atomic_compare_exchange((p), (o), (n))
17
+ __atomic_compare_exchange_db((p), (o), (n))
18
static inline int __atomic_inc(db_atomic_t *p)
19
{
20
int temp;
21
@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic
22
* http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
23
* which configure could be changed to use.
24
*/
25
-static inline int __atomic_compare_exchange(
26
+static inline int __atomic_compare_exchange_db(
27
db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
28
{
29
atomic_value_t was;
30
@@ -206,7 +206,7 @@ static inline int __atomic_compare_excha
31
#define atomic_dec(env, p) (--(p)->value)
32
#define atomic_compare_exchange(env, p, oldval, newval) \
33
(DB_ASSERT(env, atomic_read(p) == (oldval)), \
34
- atomic_init(p, (newval)), 1)
35
+ db_atomic_init(p, (newval)), 1)
36
#else
37
#define atomic_inc(env, p) __atomic_inc(env, p)
38
#define atomic_dec(env, p) __atomic_dec(env, p)
39
40