Skip to content

Commit

Permalink
rename running -> alive
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgal committed Jul 29, 2014
1 parent 8abebc4 commit 7768779
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion jvm.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ JVM.prototype.run = function(className) {

ctx.thread = CLASSES.mainThread = CLASSES.newObject(CLASSES.java_lang_Thread);
ctx.thread.pid = util.id();
ctx.thread.running = true;
ctx.thread.alive = true;
caller.stack.push(CLASSES.mainThread);
caller.stack.push(ctx.newString("main"));
ctx.pushFrame(CLASSES.getMethod(CLASSES.java_lang_Thread, "<init>", "(Ljava/lang/String;)V"), 2);
Expand Down
6 changes: 3 additions & 3 deletions native.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ Native["java/lang/Thread.start0.()V"] = function(ctx, stack) {
// on already running threads.
if (thread === CLASSES.mainThread || thread.Thread$running)
ctx.raiseException("java/lang/IllegalThreadStateException");
thread.running = true;
thread.alive = true;
thread.pid = util.id();
var run = CLASSES.getMethod(thread.class, "run", "()V", false, true);
// Create a context for the thread and start it.
Expand Down Expand Up @@ -372,11 +372,11 @@ Native["java/lang/Thread.start0.()V"] = function(ctx, stack) {
}
Native["java/lang/Thread.internalExit.()V"] = function(ctx, stack) {
stack.pop().running = false;
stack.pop().alive = false;
}
Native["java/lang/Thread.isAlive.()Z"] = function(ctx, stack) {
stack.push(stack.pop().running ? 1 : 0);
stack.push(stack.pop().alive ? 1 : 0);
}
Native["java/lang/Thread.sleep.(J)V"] = function(ctx, stack) {
Expand Down

0 comments on commit 7768779

Please sign in to comment.