Release locks on abort
Fixes deadlock if hook_checkout returns ABORT. One of these days I want to implement the abort mechanism through exceptions, even though that means handling it explicitly in more places. Or maybe *because* that means handling it explicitly in more places.
This commit is contained in:
parent
094fbcb1db
commit
6089e212dc
2 changed files with 5 additions and 0 deletions
|
@ -60,6 +60,10 @@ sub release_lock() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub release_all_locks() {
|
||||||
|
release_lock while $lockcount;
|
||||||
|
}
|
||||||
|
|
||||||
sub with_lock :prototype(&) ($code) {
|
sub with_lock :prototype(&) ($code) {
|
||||||
get_lock;
|
get_lock;
|
||||||
my @rv;
|
my @rv;
|
||||||
|
|
1
revbank
1
revbank
|
@ -143,6 +143,7 @@ OUTER: for (;;) {
|
||||||
@retry = ();
|
@retry = ();
|
||||||
call_hooks "abort", $cart, \@_;
|
call_hooks "abort", $cart, \@_;
|
||||||
$cart->empty;
|
$cart->empty;
|
||||||
|
RevBank::FileIO::release_all_locks;
|
||||||
{ no warnings; redo OUTER; }
|
{ no warnings; redo OUTER; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue