Permalink
Browse files

Redo bugfix: "spawn_link(F),exit(normal)" caused new proc to be termi…

…nated
  • Loading branch information...
1 parent b9708e7 commit 0db76a8f6a62c845580b87399787476516fcfcff @esstrifork esstrifork committed Jan 28, 2014
Showing with 22 additions and 24 deletions.
  1. +22 −24 src/main/java/erjang/ETask.java
@@ -315,30 +315,28 @@ public final void send_exit(EHandle from, EObject reason, boolean is_erlang_exit
if (!is_erlang_exit2)
unlink_oneway(from);
- synchronized (this) {
- switch (pstate) {
-
- // process is already "done", just ignore exit signal
- case DONE:
- return;
-
- // we have already received one exit signal, ignore
- // subsequent ones...
- case EXIT_SIG:
- case SENDING_EXIT:
- // TODO: warn that this process is not yet dead. why?
- return;
-
- case INIT:
- case RUNNING:
- process_incoming_exit(from, reason, is_erlang_exit2);
- return;
-
- default:
- throw new Error("unknown state? "+pstate);
- }
- }
- }
+ switch (pstate) {
+
+ // process is already "done", just ignore exit signal
+ case DONE:
+ return;
+
+ // we have already received one exit signal, ignore
+ // subsequent ones...
+ case EXIT_SIG:
+ case SENDING_EXIT:
+ // TODO: warn that this process is not yet dead. why?
+ return;
+
+ case INIT:
+ case RUNNING:
+ break;
+
+ default:
+ throw new Error("unknown state? "+pstate);
+ }
+ process_incoming_exit(from, reason, is_erlang_exit2);
+ }
protected abstract void process_incoming_exit(EHandle from, EObject reason, boolean is_erlang_exit2) throws Pausable
;

0 comments on commit 0db76a8

Please sign in to comment.