Permalink
Browse files

Fix bug: "spawn_link(F), exit(normal)" caused new proc to be terminat…

…ed immediately
  • Loading branch information...
1 parent 901e0ff commit b9708e7d257414bfb42620b2770ffacff1135055 @esstrifork esstrifork committed Jan 28, 2014
Showing with 6 additions and 16 deletions.
  1. +6 −16 src/main/java/erjang/ETask.java
@@ -329,25 +329,15 @@ public final void send_exit(EHandle from, EObject reason, boolean is_erlang_exit
// TODO: warn that this process is not yet dead. why?
return;
- // the process is not running yet, this should not happen
case INIT:
- if (reason == EProc.am_kill) {
- this.exit_reason = EProc.am_killed;
- } else {
- this.exit_reason = reason;
- }
- this.pstate = STATE.EXIT_SIG;
- return;
-
- default:
- throw new Error("unknown state? "+pstate);
-
case RUNNING:
- }
- }
-
- process_incoming_exit(from, reason, is_erlang_exit2);
+ process_incoming_exit(from, reason, is_erlang_exit2);
+ return;
+ default:
+ throw new Error("unknown state? "+pstate);
+ }
+ }
}
protected abstract void process_incoming_exit(EHandle from, EObject reason, boolean is_erlang_exit2) throws Pausable

0 comments on commit b9708e7

Please sign in to comment.