Make doAtomicSection() return the callback result