Review of a "PriorityCell" for UB - intended to safely share state between main and interrupt handlers

embedded code review help

We're currently working on an IEEE 802.15.4 TSCH protocol implementation. In that context I'm trying to flesh out some experimental primitives.

One of those tries to address the evergreen problem of how to safely and efficiently share resources between thread context and handlers running at different priorities: x/src/util/sync/priority_cell.rs at main · fg-cfh/x · GitHub

The "PriorityCell" primitive is special in that it intends to enable fine-grained, lock-free sharing w/o disabling interrupts or other heavy synchronization mechanisms, similarly to an MPMC one-shot channel, but heavily optimized for single-core ARMv7/8.

Do you think that this "PriorityCell" is safe?

(Please disregard that "x" name - it intends nothing, it only documents my lack of creativity.)