Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix thinko in scheduler that swallowed exceptions.
Deals with a bunch of silent failures that made debugging harder.
  • Loading branch information
jnthn committed Nov 24, 2015
1 parent 866e2f1 commit 9345857
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/core/ThreadPoolScheduler.pm
Expand Up @@ -42,20 +42,18 @@ my class ThreadPoolScheduler does Scheduler {
my Mu $task := nqp::shift($!queue);
$!counts_lock.protect: { $!loads = $!loads + 1 };
try {
try {
if nqp::islist($task) {
my Mu $code := nqp::shift($task);
my \args = nqp::p6bindattrinvres(nqp::create(List), List, '$!reified', $task);
$code(|args);
}
else {
$task();
}
CONTROL {
default {
my Mu $vm-ex := nqp::getattr(nqp::decont($_), Exception, '$!ex');
nqp::getcomp('perl6').handle-control($vm-ex);
}
if nqp::islist($task) {
my Mu $code := nqp::shift($task);
my \args = nqp::p6bindattrinvres(nqp::create(List), List, '$!reified', $task);
$code(|args);
}
else {
$task();
}
CONTROL {
default {
my Mu $vm-ex := nqp::getattr(nqp::decont($_), Exception, '$!ex');
nqp::getcomp('perl6').handle-control($vm-ex);
}
}
CATCH {
Expand Down

0 comments on commit 9345857

Please sign in to comment.