Use sm_decrementer to remove another explicit try/catch
This commit is contained in:
parent
61a6db080d
commit
d3d42c5f54
@ -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);
|
||||||
|
write_ref wr = bm_->write_lock_zero(b, v);
|
||||||
add_shadow(b);
|
add_shadow(b);
|
||||||
try {
|
decrementer.dont_bother();
|
||||||
return bm_->write_lock_zero(b, v);
|
return wr;
|
||||||
} catch (...) {
|
|
||||||
remove_shadow(b);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
} catch (...) {
|
|
||||||
sm_->dec(b);
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: make exception safe
|
// FIXME: make exception safe
|
||||||
|
Loading…
Reference in New Issue
Block a user