Skip to content

Commit

Permalink
doc and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mikanystrom-intel committed Jun 21, 2018
1 parent e5a9728 commit 48e20f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion m3-libs/m3core/src/coroutine/UCONTEXT/CoroutineUcontext.i3
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ TYPE
arg : REFANY;
firstcaller : T; (* special trick for passing initial caller into
a coroutine the first time it runs *)
dbg := 'A';
this : T; (* the coroutine itself *)
END;

Expand Down
11 changes: 5 additions & 6 deletions m3-libs/m3core/src/coroutine/UCONTEXT/CoroutineUcontext.m3
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ REVEAL
isAlive := TRUE;
id : UNTRACED REF INTEGER; (* Tabulate() fills this in *)
firstcall := TRUE; (* first call *)
arg : Arg;
from : T := NIL;
gcstack : ADDRESS; (* StackState from ThreadPThread.i3 *)
arg : Arg; (* data needed for the Closure *)
from : T := NIL; (* used to pass caller to callee in Call() *)
gcstack : ADDRESS; (* StackState from ThreadPThread.i3 *)
succ : T := NIL; (* successor if we run off end *)
dead : T := NIL;
dead : T := NIL; (* notification to successor that someone died *)
END;

VAR coArr := NEW(REF ARRAY OF T, 1); (* entry 0 not used *)
Expand Down Expand Up @@ -77,7 +77,7 @@ PROCEDURE Create(cl : Closure) : T =

(* need to get the context here *)
<*ASSERT cl # NIL*>
WITH arg = NEW(Arg, arg := cl, dbg := 'B'),
WITH arg = NEW(Arg, arg := cl),
ssz = Thread.GetDefaultStackSize(),
ctx = ContextC.MakeContext(Run, ssz, arg),
stackbase = ContextC.GetStackBase(ctx),
Expand Down Expand Up @@ -171,7 +171,6 @@ PROCEDURE Run(arg : Arg) =
RTIO.PutText("\n");
DbgStackInfo("Run start");
RTIO.Flush();
RTIO.PutChar(arg.dbg); RTIO.PutText("\n");
END;

<*ASSERT arg # NIL*>
Expand Down

0 comments on commit 48e20f1

Please sign in to comment.