Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit44cd47c

Browse files
committed
Make fallback implementation of pg_memory_barrier() work.
The fallback implementation involves acquiring and releasing a spinlockvariable that is otherwise unreferenced --- not even to the extent ofinitializing it. This accidentally fails to fail on platforms wherespinlocks should be initialized to zeroes, but elsewhere it results ina "stuck spinlock" failure during startup.I griped about this last July, and put in a hack that worked for gccon HPPA, but didn't get around to fixing the general case. Per thediscussion back then, the best thing to do seems to be to initializedummy_spinlock in main.c.
1 parentc1907f0 commit44cd47c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎src/backend/main/main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
#include"bootstrap/bootstrap.h"
3838
#include"common/username.h"
3939
#include"postmaster/postmaster.h"
40+
#include"storage/barrier.h"
41+
#include"storage/spin.h"
4042
#include"tcop/tcopprot.h"
4143
#include"utils/help_config.h"
4244
#include"utils/memutils.h"
@@ -288,6 +290,12 @@ startup_hacks(const char *progname)
288290
SetErrorMode(SEM_FAILCRITICALERRORS |SEM_NOGPFAULTERRORBOX);
289291
}
290292
#endif/* WIN32 */
293+
294+
/*
295+
* Initialize dummy_spinlock, in case we are on a platform where we have
296+
* to use the fallback implementation of pg_memory_barrier().
297+
*/
298+
SpinLockInit(&dummy_spinlock);
291299
}
292300

293301

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp