Re: convert SpinLock* macros to static inline functions

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2026-02-23T21:33:46Z
Lists: pgsql-hackers
On Thu, Feb 19, 2026 at 10:08:20AM -0600, Nathan Bossart wrote:
> Perhaps it's still worth doing out of an abundance of caution, or maybe I
> am missing something subtle about the liberties that compilers take in this
> area...

Committed.  I ended up abandoning 0001 and adding volatile to the SpinLock*
function signatures, as Andres suggested.

-- 
nathan



Commits

  1. Convert SpinLock* macros to static inline functions.

  2. Remove SpinLockFree() and S_LOCK_FREE().

  3. Change the spinlock primitives to function as compiler barriers.