Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid triggering JVM interop load at startup.
Was accidentally introduced when adding support for $*THREAD. This
hopefully makes things less bad with the eval server.
  • Loading branch information
jnthn committed Nov 7, 2013
1 parent 84d2cb8 commit 4ce2bfa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/vm/jvm/core/Threading.pm
Expand Up @@ -58,11 +58,12 @@ my class Thread {
{
# This code is a little funky to avoid hitting jvmbootinterop at startup
# even if we never use anything that needs it. This is because it carries
# some cost and may have a bad interaction with the evalserver.
# some cost and has a very bad interaction with the evalserver.
my int $not_yet = 1;
my $init_thread;
PROCESS::<$THREAD> := Proxy.new(
FETCH => -> | {
unless nqp::isconcrete($init_thread) {
unless nqp::isconcrete($init_thread) || $not_yet {
my $interop := nqp::jvmbootinterop();
my \JVMThread := $interop.typeForName('java.lang.Thread');
$init_thread := nqp::create(Thread);
Expand All @@ -75,6 +76,7 @@ my class Thread {
STORE => -> | {
X::Assignment::RO.new.throw
});
$not_yet = 0;
}

# A simple, reentrant lock mechanism.
Expand Down

0 comments on commit 4ce2bfa

Please sign in to comment.