Permalink
Browse files

Fixed issue 49: Exit reason 'kill' is not converted to 'killed'

I.e., when trapping exit, send self a {'EXIT', from, reason}
instead of propagating process termination signal.
  • Loading branch information...
1 parent 5ec2f08 commit 16abd1b5440fe83bb1973fe9248ac78ef010d4e1 @edwardw edwardw committed Jun 18, 2011
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/main/java/erjang/EProc.java
@@ -243,19 +243,19 @@ protected void process_incoming_exit(EHandle from, EObject reason, boolean is_er
}
- if (reason == am_kill) {
- this.exit_reason = am_killed;
- this.pstate = STATE_EXIT_SIG;
- this.resume();
-
- } else if (trap_exit == ERT.TRUE) {
+ if (trap_exit == ERT.TRUE) {
// we're trapping exits, so we in stead send an {'EXIT', from,
// reason} to self
ETuple msg = ETuple.make(ERT.am_EXIT, from, reason);
// System.err.println("kill message to self: "+msg);
mbox.put(msg);
+ } else if (reason == am_kill) {
+ this.exit_reason = am_killed;
+ this.pstate = STATE_EXIT_SIG;
+ this.resume();
+
} else if (reason != am_normal) {
// System.err.println("kill signal: " +reason + " from "+from);
// try to kill this thread

0 comments on commit 16abd1b

Please sign in to comment.