Hi.
Use pg_atomic_fetch_add_u64 to replace pg_atomic_read_u64 andpg_atomic_write_u64 calls.
This simplifies the logic and this increases the likelihood that theoperation will be successful.
patch attached.
best regards,Ranier Vilela