Thread: pgsql: Make fallback implementation of pg_memory_barrier() work.

pgsql: Make fallback implementation of pg_memory_barrier() work.

From
Tom Lane
Date:
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(+)