diff -ruN db-6.0.19-orig/src/dbinc/atomic.h db-6.0.19/src/dbinc/atomic.h --- db-6.0.19-orig/src/dbinc/atomic.h 2013-05-31 10:00:12.000000000 -0500 +++ db-6.0.19/src/dbinc/atomic.h 2020-10-27 20:06:02.000000000 -0500 @@ -70,7 +70,7 @@ * These have no memory barriers; the caller must include them when necessary. */ #define atomic_read(p) ((p)->value) -#define atomic_init(p, val) ((p)->value = (val)) +#define atomic_init_db(p, val) ((p)->value = (val)) #ifdef HAVE_ATOMIC_SUPPORT @@ -206,7 +206,7 @@ #define atomic_dec(env, p) (--(p)->value) #define atomic_compare_exchange(env, p, oldval, newval) \ (DB_ASSERT(env, atomic_read(p) == (oldval)), \ - atomic_init(p, (newval)), 1) + atomic_init_db(p, (newval)), 1) #else #define atomic_inc(env, p) __atomic_inc(env, p) #define atomic_dec(env, p) __atomic_dec(env, p) diff -ruN db-6.0.19-orig/src/mp/mp_fget.c db-6.0.19/src/mp/mp_fget.c --- db-6.0.19-orig/src/mp/mp_fget.c 2013-05-31 10:00:12.000000000 -0500 +++ db-6.0.19/src/mp/mp_fget.c 2020-10-27 20:06:02.000000000 -0500 @@ -653,7 +653,7 @@ /* Initialize enough so we can call __memp_bhfree. */ alloc_bhp->flags = 0; - atomic_init(&alloc_bhp->ref, 1); + atomic_init_db(&alloc_bhp->ref, 1); #ifdef DIAGNOSTIC if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) { __db_errx(env, DB_STR("3025", @@ -968,7 +968,7 @@ MVCC_MPROTECT(bhp->buf, mfp->pagesize, PROT_READ); - atomic_init(&alloc_bhp->ref, 1); + atomic_init_db(&alloc_bhp->ref, 1); MUTEX_LOCK(env, alloc_bhp->mtx_buf); alloc_bhp->priority = bhp->priority; alloc_bhp->pgno = bhp->pgno; diff -ruN db-6.0.19-orig/src/mp/mp_mvcc.c db-6.0.19/src/mp/mp_mvcc.c --- db-6.0.19-orig/src/mp/mp_mvcc.c 2013-05-31 10:00:12.000000000 -0500 +++ db-6.0.19/src/mp/mp_mvcc.c 2020-10-27 20:06:02.000000000 -0500 @@ -281,7 +281,7 @@ #else memcpy(frozen_bhp, bhp, SSZA(BH, buf)); #endif - atomic_init(&frozen_bhp->ref, 0); + atomic_init_db(&frozen_bhp->ref, 0); if (mutex != MUTEX_INVALID) frozen_bhp->mtx_buf = mutex; else if ((ret = __mutex_alloc(env, MTX_MPOOL_BH, @@ -440,7 +440,7 @@ #endif alloc_bhp->mtx_buf = mutex; MUTEX_LOCK(env, alloc_bhp->mtx_buf); - atomic_init(&alloc_bhp->ref, 1); + atomic_init_db(&alloc_bhp->ref, 1); F_CLR(alloc_bhp, BH_FROZEN); } diff -ruN db-6.0.19-orig/src/mp/mp_region.c db-6.0.19/src/mp/mp_region.c --- db-6.0.19-orig/src/mp/mp_region.c 2013-05-31 10:00:12.000000000 -0500 +++ db-6.0.19/src/mp/mp_region.c 2020-10-27 20:06:02.000000000 -0500 @@ -263,7 +263,7 @@ MTX_MPOOL_FILE_BUCKET, 0, &htab[i].mtx_hash)) != 0) return (ret); SH_TAILQ_INIT(&htab[i].hash_bucket); - atomic_init(&htab[i].hash_page_dirty, 0); + atomic_init_db(&htab[i].hash_page_dirty, 0); } mtx_base = mtx_prev = MUTEX_INVALID; @@ -317,7 +317,7 @@ DB_MUTEX_SHARED, &hp->mtx_hash)) != 0) return (ret); SH_TAILQ_INIT(&hp->hash_bucket); - atomic_init(&hp->hash_page_dirty, 0); + atomic_init_db(&hp->hash_page_dirty, 0); #ifdef HAVE_STATISTICS hp->hash_io_wait = 0; hp->hash_frozen = hp->hash_thawed = hp->hash_frozen_freed = 0; diff -ruN db-6.0.19-orig/src/mutex/mut_method.c db-6.0.19/src/mutex/mut_method.c --- db-6.0.19-orig/src/mutex/mut_method.c 2013-05-31 10:00:12.000000000 -0500 +++ db-6.0.19/src/mutex/mut_method.c 2020-10-27 20:06:02.000000000 -0500 @@ -474,7 +474,7 @@ MUTEX_LOCK(env, mtx); ret = atomic_read(v) == oldval; if (ret) - atomic_init(v, newval); + atomic_init_db(v, newval); MUTEX_UNLOCK(env, mtx); return (ret); diff -ruN db-6.0.19-orig/src/mutex/mut_tas.c db-6.0.19/src/mutex/mut_tas.c --- db-6.0.19-orig/src/mutex/mut_tas.c 2013-05-31 10:00:12.000000000 -0500 +++ db-6.0.19/src/mutex/mut_tas.c 2020-10-27 20:06:02.000000000 -0500 @@ -47,7 +47,7 @@ #ifdef HAVE_SHARED_LATCHES if (F_ISSET(mutexp, DB_MUTEX_SHARED)) - atomic_init(&mutexp->sharecount, 0); + atomic_init_db(&mutexp->sharecount, 0); else #endif if (MUTEX_INIT(&mutexp->tas)) { @@ -536,7 +536,7 @@ F_CLR(mutexp, DB_MUTEX_LOCKED); /* Flush flag update before zeroing count */ MEMBAR_EXIT(); - atomic_init(&mutexp->sharecount, 0); + atomic_init_db(&mutexp->sharecount, 0); } else { DB_ASSERT(env, sharecount > 0); MEMBAR_EXIT(); diff -ruN db-6.0.19-orig/util/db_dump185.c db-6.0.19/util/db_dump185.c --- db-6.0.19-orig/util/db_dump185.c 2013-05-31 10:00:15.000000000 -0500 +++ db-6.0.19/util/db_dump185.c 2020-10-27 20:06:33.000000000 -0500 @@ -19,6 +19,7 @@ #include #include #include +#include #ifdef HAVE_DB_185_H #include