Busted includes somewhere near worker_internal.h

Started by Tom Laneover 5 years ago3 messageshackers
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

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?

regards, tom lane

#2Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#1)
Re: Busted includes somewhere near worker_internal.h

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: /messages/by-id/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

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#2)
Re: Busted includes somewhere near worker_internal.h

Andres Freund <andres@anarazel.de> writes:

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;
^~~~~~~

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

Done that way.

regards, tom lane