Scoped lock wrapping an atomic bool.
Lock, call dg(), then unlock.
Attempt to lock, and if successful, call dg() then unlock.
Static factory method.
See Implementation
Scoped lock wrapping an atomic bool.