-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48e20f1
commit 8794ee9
Showing
3 changed files
with
164 additions
and
70 deletions.
There are no files selected for viewing
18 changes: 12 additions & 6 deletions
18
m3-libs/m3core/src/coroutine/UCONTEXT/CoroutineUcontext.i3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
INTERFACE CoroutineUcontext; | ||
FROM Coroutine IMPORT T; | ||
UNSAFE INTERFACE CoroutineUcontext; | ||
FROM Coroutine IMPORT T, Closure; | ||
|
||
TYPE | ||
Arg = REF RECORD | ||
arg : REFANY; | ||
firstcaller : T; (* special trick for passing initial caller into | ||
a coroutine the first time it runs *) | ||
this : T; (* the coroutine itself *) | ||
cl : Closure; | ||
firstcaller : T; (* special trick for passing initial caller into | ||
a coroutine the first time it runs, gets NILed | ||
right away *) | ||
id : Id; (* need this to find my coroutine in Run *) | ||
END; | ||
|
||
Entry = PROCEDURE(arg : Arg); | ||
|
||
Id = UNTRACED REF INTEGER; | ||
(* this strange declaration is used because our Id is held as a thread | ||
local (i.e., global) with pthreads thread local system. That system | ||
can only handle pointers. *) | ||
|
||
END CoroutineUcontext. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.