Re: Busted includes somewhere near worker_internal.h - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Busted includes somewhere near worker_internal.h
Date
Msg-id 20200717202414.457tu2b7ygrxcsi7@alap3.anarazel.de
Whole thread Raw
In response to Busted includes somewhere near worker_internal.h  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Busted includes somewhere near worker_internal.h  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

On 2020-07-17 16:09:14 -0400, Tom Lane wrote:
> headerscheck and cpluspluscheck are both unhappy about this:
> 
> ./src/include/replication/worker_internal.h:49:2: error: unknown type name 'slock_t'
>   slock_t  relmutex;
>   ^~~~~~~
> 
> Now, worker_internal.h itself hasn't changed in some time.
> I conclude that somebody rearranged one of the header files
> it depends on.  Anyone have an idea what the relevant change
> was?  Should we just include spin.h here, or is there a
> better fix?

I'm probably to blame for that - I've removed the s_lock.h (it wasn't
spin.h for some reason) include from lwlock.h:

commit f219167910ad33dfd8f1b0bba15323d71a91c4e9
Author: Andres Freund <andres@anarazel.de>
Date:   2020-06-18 19:40:09 -0700

    Clean up includes of s_lock.h.
    
    Users of spinlocks should use spin.h, not s_lock.h. And lwlock.h
    hasn't utilized spinlocks for quite a while.
    
    Discussion: https://postgr.es/m/20200618183041.upyrd25eosecyf3x@alap3.anarazel.de

I think including spin.h is the right fix, given that it needs to know
the size of s_lock.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Busted includes somewhere near worker_internal.h
Next
From: Nikita Glukhov
Date:
Subject: Re: SQL/JSON: functions