mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-09 08:10:09 +08:00
Fix pg_atomic_u64 initialization.
As Andres pointed out, pg_atomic_init_u64 must be used to initialize an atomic variable, before it can be accessed with the actual atomic ops. Trying to use pg_atomic_write_u64 on an uninitialized variable leads to a failure with the fallback implementation that uses a spinlock. Discussion: https://www.postgresql.org/message-id/20170816191346.d3ke5tpshhco4bnd%40alap3.anarazel.de
This commit is contained in:
parent
ec0a69e49b
commit
dcd052c8d2
@ -1638,7 +1638,7 @@ heap_parallelscan_initialize(ParallelHeapScanDesc target, Relation relation,
|
||||
target->phs_nblocks > NBuffers / 4;
|
||||
SpinLockInit(&target->phs_mutex);
|
||||
target->phs_startblock = InvalidBlockNumber;
|
||||
pg_atomic_write_u64(&target->phs_nallocated, 0);
|
||||
pg_atomic_init_u64(&target->phs_nallocated, 0);
|
||||
SerializeSnapshot(snapshot, target->phs_snapshot_data);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user