8554
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2004 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
|
8553
|
13 |
"{ Package: 'stx:libbasic' }"
|
|
14 |
|
|
15 |
Object subclass:#Continuation
|
|
16 |
instanceVariableNames:'process id suspendContext'
|
|
17 |
classVariableNames:''
|
|
18 |
poolDictionaries:''
|
|
19 |
category:'Kernel-Processes'
|
|
20 |
!
|
|
21 |
|
8554
|
22 |
!Continuation class methodsFor:'documentation'!
|
|
23 |
|
|
24 |
copyright
|
|
25 |
"
|
|
26 |
COPYRIGHT (c) 2004 by eXept Software AG
|
|
27 |
All Rights Reserved
|
|
28 |
|
|
29 |
This software is furnished under a license and may be used
|
|
30 |
only in accordance with the terms of that license and with the
|
|
31 |
inclusion of the above copyright notice. This software may not
|
|
32 |
be provided or otherwise made available to, or used by, any
|
|
33 |
other person. No title to or ownership of the software is
|
|
34 |
hereby transferred.
|
|
35 |
"
|
|
36 |
!
|
|
37 |
|
|
38 |
documentation
|
|
39 |
"
|
|
40 |
Initial attempt - Contnuations do not work yet.
|
|
41 |
|
|
42 |
[Instance variables:]
|
|
43 |
|
|
44 |
id <SmallInteger> a unique continuation-id;
|
|
45 |
Used to identify a corresponding
|
|
46 |
data-structure in the VM.
|
|
47 |
|
|
48 |
process <Process> the process which created this continuation.
|
|
49 |
|
|
50 |
[Class variables:]
|
|
51 |
|
|
52 |
[see also:]
|
|
53 |
Process Context Block
|
|
54 |
|
|
55 |
[author:]
|
|
56 |
Claus Gittinger
|
|
57 |
"
|
|
58 |
! !
|
8553
|
59 |
|
8557
|
60 |
!Continuation class methodsFor:'instance creation'!
|
|
61 |
|
|
62 |
new
|
|
63 |
|cont id|
|
|
64 |
|
8558
|
65 |
cont := super new.
|
8557
|
66 |
%{
|
|
67 |
int __cId;
|
8559
|
68 |
extern int __continuationCreate();
|
8557
|
69 |
|
8559
|
70 |
__cId = __continuationCreate(cont);
|
8557
|
71 |
if (__cId) {
|
|
72 |
id = __MKSMALLINT(__cId);
|
|
73 |
}
|
|
74 |
%}.
|
|
75 |
id isNil ifTrue:[
|
|
76 |
self error:'could not create continuation' mayProceed:true.
|
|
77 |
^ nil.
|
|
78 |
].
|
|
79 |
cont setId:id process:(Processor activeProcess).
|
|
80 |
^ cont
|
|
81 |
! !
|
|
82 |
|
|
83 |
!Continuation methodsFor:'private accessing'!
|
|
84 |
|
|
85 |
setId:idArg process:aProcess
|
|
86 |
id := idArg.
|
|
87 |
process := aProcess.
|
|
88 |
! !
|
|
89 |
|
8553
|
90 |
!Continuation class methodsFor:'documentation'!
|
|
91 |
|
|
92 |
version
|
8559
|
93 |
^ '$Header: /cvs/stx/stx/libbasic/Continuation.st,v 1.5 2004-09-20 14:27:04 cg Exp $'
|
8553
|
94 |
! !
|