pgsql: Make fallback implementation of pg_memory_barrier() work.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Make fallback implementation of pg_memory_barrier() work.
Date: 2014-05-17 22:29:56
Message-ID: E1Wln76-0002tH-2X@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-05-18 20:52:15 pgsql: Fix two ancient memory-leak bugs in relcache.c.
Previous Message Tom Lane 2014-05-17 21:57:59 pgsql: Fix a bunch of functions that were declared static then defined