Use sm_decrementer to remove another explicit try/catch

This commit is contained in:
Joe Thornber 2011-11-08 11:08:51 +00:00
parent 61a6db080d
commit d3d42c5f54

View File

@ -39,18 +39,11 @@ transaction_manager::write_ref
transaction_manager::new_block(validator v) transaction_manager::new_block(validator v)
{ {
block_address b = sm_->new_block(); block_address b = sm_->new_block();
try { sm_decrementer decrementer(sm_, b);
add_shadow(b); write_ref wr = bm_->write_lock_zero(b, v);
try { add_shadow(b);
return bm_->write_lock_zero(b, v); decrementer.dont_bother();
} catch (...) { return wr;
remove_shadow(b);
throw;
}
} catch (...) {
sm_->dec(b);
throw;
}
} }
// FIXME: make exception safe // FIXME: make exception safe