codegen: Treat atomic operations as reset-unsafe points
The cancellation-lowering pass skipped every atomic store when collecting
unsafe points, as a proxy for recognizing its own reset_ctx bookkeeping
stores, and never considered cmpxchg/atomicrmw at all. A reset region thus
stayed published across user atomic operations, so a SAFE cancellation
delivered around e.g. a spin-lock acquire (cmpxchg) or release (atomic
store) would longjmp away and leave the lock owned forever.
Mark the pass's own stores with the julia.reset_safe metadata instead, and
treat unmarked atomic stores and read-modify-write operations as unsafe
points that clear the published reset region.
Reported in JuliaLang/julia#60281 (comment):
https://github.com/JuliaLang/julia/pull/60281#discussion_r3581930671
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TPMqtAGKwxaitJWknYkRcX