Permalink
Browse files

Simplify EProc.execute main loop

This just makes the code slightly simpler, shaving
one local variable off the stack state for all
processes.
  • Loading branch information...
1 parent 0d67e97 commit db7a40d5375ac6fea3d42b85be97395ea8444de5 @krestenkrab krestenkrab committed Sep 25, 2013
Showing with 14 additions and 18 deletions.
  1. +14 −18 src/main/java/erjang/EProc.java
@@ -572,29 +572,25 @@ private void execute0(Throwable[] death, EObject result) throws ErlangHalt,
private EObject execute1() throws Pausable {
EObject result;
this.check_exit();
-
-// synchronized(this) {
- this.pstate = STATE.RUNNING;
-// }
-
- boolean live = true;
- while (live) {
- try {
- while(this.tail.go(this) == TAIL_MARKER) {
- /* skip */
- }
- live = false;
+
+ // synchronized(this) {
+ this.pstate = STATE.RUNNING;
+ // }
+
+ hibernate_loop:
+ while (true) {
+ try {
+ while (this.tail.go(this) == TAIL_MARKER) {
+ /* skip */
+ }
+ break hibernate_loop;
} catch (ErjangHibernateException e) {
// noop, live = true //
}
-
- if (live == true) {
-
- mbox_wait();
- }
+ mbox_wait();
}
-
+
result = am_normal;
return result;
}

0 comments on commit db7a40d

Please sign in to comment.