pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Subject: Re: small cleanup for s_lock.h
Date: Thu, 7 May 2026 16:12:09 -0500
Message-ID: <af0AKUfzjGDvQdBk@nathan> (raw)
In-Reply-To: <afz5FHWr6rOB7bsL@nathan>
References: <afkUeI7UhacZ5ZFm@nathan>
	<369933.1777933007@sss.pgh.pa.us>
	<afoWBgsygtkCNCRQ@nathan>
	<532705.1778000169@sss.pgh.pa.us>
	<afovdi61nybDRbC3@nathan>
	<afz5FHWr6rOB7bsL@nathan>

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





view thread (14+ messages)  latest in thread

Message-ID: <af0AKUfzjGDvQdBk@nathan>
Permalink:  ../af0AKUfzjGDvQdBk@nathan/
Also on:    postgresql.org/message-id/af0AKUfzjGDvQdBk@nathan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: small cleanup for s_lock.h
  In-Reply-To: <af0AKUfzjGDvQdBk@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox