I think the shared lock idea ddaa outlines is a good one, and likely to be simpler than other approaches.
I think the shared lock idea ddaa outlines is a good one, and likely to be simpler than other approaches.