Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
De-confuse start/run on Thread.
We use .run on the Scheduler to mean "run this thing", and .run on
a Promise to mean "promise to run this thing", so Thread.run should
really mean "run this on a new thread".
  • Loading branch information
jnthn committed Oct 31, 2013
1 parent 09a2ec1 commit b83de34
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/vm/jvm/core/Threading.pm
Expand Up @@ -28,11 +28,11 @@ my class Thread {
$!jvm_thread.setDaemon(1) if $!app_lifetime;
}

method start(&code, *%adverbs) {
Thread.new(:&code, |%adverbs).run()
method run(&code, *%adverbs) {
Thread.new(:&code, |%adverbs).start()
}

method run(Thread:D:) {
method start(Thread:D:) {
$!jvm_thread.start();
self
}
Expand Down Expand Up @@ -159,7 +159,7 @@ my class ThreadPoolScheduler does Scheduler {
if $!thread_start_semaphore.'method/tryAcquire/(I)Z'(1) {
my $interop := nqp::jvmbootinterop();
$!started_any = 1;
Thread.start(:app_lifetime, {
Thread.run(:app_lifetime, {
loop {
my Mu $task := $interop.javaObjectToSixmodel($!queue.take());
try {
Expand Down

0 comments on commit b83de34

Please sign in to comment.