pgsql: Make fallback implementation of pg_memory_barrier() work. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Make fallback implementation of pg_memory_barrier() work.
Date
Msg-id E1Wln76-0002tH-2X@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Make fallback implementation of pg_memory_barrier() work.

The fallback implementation involves acquiring and releasing a spinlock
variable that is otherwise unreferenced --- not even to the extent of
initializing it.  This accidentally fails to fail on platforms where
spinlocks should be initialized to zeroes, but elsewhere it results in
a "stuck spinlock" failure during startup.

I griped about this last July, and put in a hack that worked for gcc
on HPPA, but didn't get around to fixing the general case.  Per the
discussion back then, the best thing to do seems to be to initialize
dummy_spinlock in main.c.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/44cd47c1d49655c5dd9648bde8e267617c3735b4

Modified Files
--------------
src/backend/main/main.c |    8 ++++++++
1 file changed, 8 insertions(+)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix a bunch of functions that were declared static then defined
Next
From: Tom Lane
Date:
Subject: pgsql: Fix two ancient memory-leak bugs in relcache.c.