Skip to content

Commit

Permalink
[Truffle] Thread.main.
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Mar 13, 2015
1 parent 770be9e commit d688c81
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 0 additions & 1 deletion spec/truffle/tags/core/thread/main_tags.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,24 @@ private Object joinMillis(RubyThread self, int timeoutInMillis) {

}

@CoreMethod(names = "main", onSingleton = true)
public abstract static class MainNode extends CoreMethodNode {

public MainNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public MainNode(MainNode prev) {
super(prev);
}

@Specialization
public RubyThread main() {
return getContext().getThreadManager().getRootThread();
}

}

@CoreMethod(names = "pass", onSingleton = true)
public abstract static class PassNode extends CoreMethodNode {

Expand Down

0 comments on commit d688c81

Please sign in to comment.