The signal shown does not require any additional state, and can be derived using combinational logic only from the other signals shown (as jmelson first noted: X = A NAND B).
Whether glitches might occur, is not indicated from the diagram (timing constraints are not provided, only lines implying synchronicity of edges). The original post suggests that glitches are tolerable, so the problem is solved.
Glitches can be resolved with a more in-depth explanation of the signal sources, or if nothing else a bit of filtering.
Also, if this is going into an MCU, the signals will be clocked sooner or later anyway -- even pin-change interrupts ultimately get read by the fixed-clock CPU. Some chatter might be desirable to avoid there (spurious interrupts can be quite troublesome), but some combination of these methods would seem to be adequate.
If it's for an analog circuit (e.g. starting a variable monostable for thyristor phase control), the signal level may be adequate, or it will be latched anyway by the timer so does not need additional clean-up.
I will note that, mains is often quite dirty, and so filtering should be done there, first and foremost, if at all possible. (This may introduce some phase error, though it may also be calibrated out in the digital signal path.)
If other uses are envisioned, perhaps they can be explained, and a better-suited solution can be offered.
Tim