People interested in this might also be interested in our article about protecting against reentrancy.