Re: small cleanup for s_lock.h - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: small cleanup for s_lock.h
Date
Msg-id af0AKUfzjGDvQdBk@nathan
Whole thread
In response to Re: small cleanup for s_lock.h  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: small cleanup for s_lock.h
List pgsql-hackers
On Thu, May 07, 2026 at 03:41:56PM -0500, Nathan Bossart wrote:
> +/*
> + * We can only define TAS_SPIN if TAS was defined.  Otherwise, the platform
> + * defined its own S_LOCK without TAS, and therefore is responsible for
> + * defining its own TAS_SPIN as well.  (Note that we currently do not have any
> + * platforms that don't define TAS.)
> + */
>  #if !defined(TAS_SPIN)
> +#if defined(TAS)
>  #define TAS_SPIN(lock)    TAS(lock)
> -#endif     /* TAS_SPIN */
> +#else
> +#error Neither TAS nor TAS_SPIN defined on this platform.  Please report this to pgsql-bugs@lists.postgresql.org.
> +#endif     /* TAS */
> +#endif     /* ! TAS_SPIN */

Wait, this isn't right.  TAS_SPIN is only used by s_lock(), which is only
used by the default S_LOCK.  We should just not compile s_lock() if the
platform defines its own S_LOCK, and we shouldn't #error here if TAS is not
defined.

-- 
nathan



pgsql-hackers by date:

Previous
From: Zsolt Parragi
Date:
Subject: Re: [PATCH] Preserve replication origin OIDs in pg_upgrade
Next
From: Nathan Bossart
Date:
Subject: Re: small cleanup for s_lock.h